STEPControl_Reader aReader = theReader.ChangeReader();
// BEGIN: reading materials of sub-shapes from file
- if ( theIsMaterials )
+ if (theIsMaterials)
{
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(ageom->impl<TopoDS_Shape>(), anIndices);
std::vector<int> aColRGB = {int(r*255),int(g*255),int(b*255)};
theResultBody->addShapeColor(aShapeName, aColRGB);
} else if (theColorTool->GetColor(theLabel, XCAFDoc_ColorCurv, aCol)) {
- double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue();
- std::vector<int> aColRGB = {int(aR*255),int(aG*255),int(aB*255)};
+ double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue();
+ std::vector<int> aColRGB = {int(aR*255),int(aG*255),int(aB*255)};
theResultBody->addShapeColor(aShapeName, aColRGB);
}
// check explicit coloring of boundary entities
TopExp_Explorer aXp2(aShape, TopAbs_FACE);
while(aXp2.More()) {
if (theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorGen, aCol) ||
- theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorSurf, aCol) ||
- theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorCurv, aCol)) {
+ theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorSurf, aCol) ||
+ theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorCurv, aCol)) {
double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue();
TopoDS_Face aFace = TopoDS::Face(aXp2.Current());
std::vector<int> aColRGB = {int(aR*255),int(aG*255),int(aB*255)};
aXp2.Next();
}
}
- if (aDim == 2) {
- TopExp_Explorer aXp1(aShape, TopAbs_EDGE);
- while(aXp1.More()) {
- if (theColorTool->GetColor(aXp1.Current(), XCAFDoc_ColorGen, aCol) ||
- theColorTool->GetColor(aXp1.Current(), XCAFDoc_ColorSurf, aCol) ||
- theColorTool->GetColor(aXp1.Current(), XCAFDoc_ColorCurv, aCol)) {
- double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue();
- std::vector<int> aColRGB = {int(aR*255),int(aG*255),int(aB*255)};
- std::wstringstream aNameEdge;
- aNameEdge << L"Edge_"<< aShapeName;
- aShapeGeom->setImpl(new TopoDS_Shape(aXp1.Current() ));
- theResultBody->addShapeColor(
- theResultBody->addShapeName(aShapeGeom , aNameEdge.str()), aColRGB);
- }
- aXp1.Next();
- }
- }
} else {
if (!theShapeTool->IsReference(theLabel) ){
TopoDS_Shape aShape = theShapeTool->GetShape(theLabel);