Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / IGESCAFControl_Reader - hierarchy

IGESCAFControl_Reader - hierarchy

IGESCAFControl_Reader - hierarchy
James D. 2012/11/12 18:15
Hi,
I have problems with my sourcecode. When I compile this, I have this in my hierarchy:

-model
--OpenCASCADE 6.5...
--- DE 3
----COLORBOX

I need only the Colorbox, not the original file DE3. I have no idea ...
I read two IGES with IGESControl_Reader and save this after bollean cut in a file3. After this I read this file with IGESCAFControl_Reader give them a color ...


IGESCAFControl_Reader myIgesReader;
...
...
...     
Handle(TDocStd_Document) aDoc;
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
anApp->NewDocument("XmlXCAF", aDoc);
                    
if (!myIgesReader.Transfer(aDoc))
{
std::cout<<"Cannot read IGES file!"<<endl;
}

TopoDS_Shape myshape = myIgesReader.OneShape();
Handle(XCAFDoc_ShapeTool) myShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
TDF_Label aLabel = myShapeTool->NewShape();

XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->SetShape(aLabel, myshape);
TDataStd_Name::Set(aLabel, "COLORBOX");

myShapeTool->SetShape(aLabel,myshape);

(myshape, colLabel, XCAFDoc_ColorGen)
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(aDoc->Main());
Quantity_Color Col(Quantity_NOC_GREEN1);
TDF_Label colLabel = myColors->AddColor(Col);
myColors->SetColor (myshape, Col, XCAFDoc_ColorGen);

IGESControl_Controller::Init();
IGESCAFControl_Writer aWriter;
..
..
..
aWriter.Transfer(aDoc);
aWriter.Write(file3);
James D. 2012/11/12 22:26
I solved the problem. I replace the following line:

TDF_Label aLabel = myShapeTool->NewShape();

TopoDS_Shape myshape = ...
with TDF_Label aLabel = myShapeTool->AddShape(myshape);

 
 
Latest news
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map