#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_ErrorHandler.hxx>
-#include <StdPrs_BndBox.hxx>
+#include <Prs3d_BndBox.hxx>
#include <StdPrs_ShadedShape.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>
#include <StdPrs_WFShape.hxx>
myPredefTexture (Graphic3d_NameOfTexture2D(0)),
myToMapTexture (Standard_True),
myModulate (Standard_True),
- myUVOrigin (0.0, 0.0),
myIsCustomOrigin (Standard_True),
- myUVRepeat (1.0, 1.0),
myToRepeat (Standard_True),
- myUVScale (1.0, 1.0),
myToScale (Standard_True),
myToShowTriangles (Standard_False)
{
}
else
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: texture with ID ") + theTextureFileName
- + " is undefined! Texture 0 will be used instead.", Message_Fail);
+ Message::SendFail (TCollection_AsciiString ("Error: texture with ID ") + theTextureFileName
+ + " is undefined. Texture 0 will be used instead.");
myPredefTexture = Graphic3d_NameOfTexture2D (0);
}
myTextureFile = "";
{
AIS_Shape::SetColor (theColor);
- for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
+ for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
{
- const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-
- if (aPrsModed.Mode() != 3)
- continue;
-
- updateAttributes (aPrsModed.Presentation()->Presentation());
+ if (aPrsIter.Value()->Mode() == 3)
+ {
+ updateAttributes (aPrsIter.Value());
+ }
}
}
void AIS_TexturedShape::UnsetColor()
{
AIS_Shape::UnsetColor();
-
- for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
- {
- const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-
- if (aPrsModed.Mode() != 3)
- continue;
-
- Handle(Prs3d_Presentation) aPrs = aPrsModed.Presentation()->Presentation();
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
-
- Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->Link()->ShadingAspect()->Aspect();
- Handle(Graphic3d_AspectLine3d) aLineAsp = myDrawer->Link()->LineAspect()->Aspect();
- Quantity_Color aColor;
- AIS_GraphicTool::GetInteriorColor (myDrawer->Link(), aColor);
- anAreaAsp->SetInteriorColor (aColor);
- // Check if aspect of given type is set for the group,
- // because setting aspect for group with no already set aspect
- // can lead to loss of presentation data
- if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
- {
- aGroup->SetGroupPrimitivesAspect (anAreaAsp);
- }
- if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_LINE))
- {
- aGroup->SetGroupPrimitivesAspect (aLineAsp);
- }
-
- updateAttributes (aPrs);
- }
}
//=======================================================================
void AIS_TexturedShape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
{
AIS_Shape::SetMaterial (theMat);
-
- for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
+ for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
{
- const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-
- if (aPrsModed.Mode() != 3)
- continue;
-
- updateAttributes (aPrsModed.Presentation()->Presentation());
+ if (aPrsIter.Value()->Mode() == 3)
+ {
+ updateAttributes (aPrsIter.Value());
+ }
}
}
void AIS_TexturedShape::UnsetMaterial()
{
AIS_Shape::UnsetMaterial();
-
- for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
+ for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
{
- const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-
- if (aPrsModed.Mode() != 3)
- continue;
-
- updateAttributes (aPrsModed.Presentation()->Presentation());
+ if (aPrsIter.Value()->Mode() == 3)
+ {
+ updateAttributes (aPrsIter.Value());
+ }
}
}
}
else
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: texture can not be loaded ") + aTextureDesc, Message_Fail);
+ Message::SendFail (TCollection_AsciiString ("Error: texture can not be loaded ") + aTextureDesc);
}
}
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (thePrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
- if (!aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
- {
- continue;
- }
aGroup->SetGroupPrimitivesAspect (myAspect);
}
}
updateAttributes (thePrs);
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure const&)
{
#ifdef OCCT_DEBUG
std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";
}
else
{
- StdPrs_BndBox::Add (thePrs, BoundingBox(), myDrawer);
+ Prs3d_BndBox::Add (thePrs, BoundingBox(), myDrawer);
}
break;
}