#include <V3d_RectangularGrid.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
-#include <Visual3d_ViewManager.hxx>
-
-/*----------------------------------------------------------------------*/
-/*
- * Static variable
- */
-static TCollection_AsciiString _XLetter() {
- static TCollection_AsciiString XLetter("X");
-return XLetter;
-}
-#define XLetter _XLetter()
-
-static TCollection_AsciiString _YLetter() {
- static TCollection_AsciiString YLetter("Y");
-return YLetter;
-}
-#define YLetter _YLetter()
-
-static TCollection_AsciiString _ZLetter() {
- static TCollection_AsciiString ZLetter("Z");
-return ZLetter;
-}
-#define ZLetter _ZLetter()
/*----------------------------------------------------------------------*/
{
myPrivilegedPlane = aPlane;
Grid()->SetDrawMode(Grid()->DrawMode());
- for (InitActiveViews (); MoreActiveViews (); NextActiveViews ())
- ActiveView ()->SetGrid (myPrivilegedPlane, Grid ());
+ for (V3d_ListOfView::Iterator anActiveViewIter (myActiveViews); anActiveViewIter.More(); anActiveViewIter.Next())
+ {
+ anActiveViewIter.Value()->SetGrid (myPrivilegedPlane, Grid());
+ }
+
if(myDisplayPlane)
DisplayPrivilegedPlane(Standard_True,myDisplayPlaneLength);
- else
- Update();
}
/*----------------------------------------------------------------------*/
}
/*----------------------------------------------------------------------*/
-void V3d_Viewer::DisplayPrivilegedPlane(const Standard_Boolean OnOff, const Quantity_Length aSize)
+void V3d_Viewer::DisplayPrivilegedPlane(const Standard_Boolean OnOff, const Standard_Real aSize)
{
- Standard_Boolean Change = (myDisplayPlane != OnOff);
myDisplayPlane = OnOff;
myDisplayPlaneLength = aSize;
if(myDisplayPlane)
{
if(myPlaneStructure.IsNull()) {
- myPlaneStructure = new Graphic3d_Structure(MyViewer);
+ myPlaneStructure = new Graphic3d_Structure(StructureManager());
myPlaneStructure->SetInfiniteState(Standard_True);
myPlaneStructure->Display();
}
const gp_Pnt pX(p0.XYZ() + myDisplayPlaneLength*myPrivilegedPlane.XDirection().XYZ());
aPrims->AddVertex(p0);
aPrims->AddVertex(pX);
- Group->Text(XLetter.ToCString(),Graphic3d_Vertex(pX.X(),pX.Y(),pX.Z()),1./81.);
+ Group->Text("X",Graphic3d_Vertex(pX.X(),pX.Y(),pX.Z()),1./81.);
const gp_Pnt pY(p0.XYZ() + myDisplayPlaneLength*myPrivilegedPlane.YDirection().XYZ());
aPrims->AddVertex(p0);
aPrims->AddVertex(pY);
- Group->Text(YLetter.ToCString(),Graphic3d_Vertex(pY.X(),pY.Y(),pY.Z()),1./81.);
+ Group->Text("Y",Graphic3d_Vertex(pY.X(),pY.Y(),pY.Z()),1./81.);
const gp_Pnt pZ(p0.XYZ() + myDisplayPlaneLength*myPrivilegedPlane.Direction().XYZ());
aPrims->AddVertex(p0);
aPrims->AddVertex(pZ);
- Group->Text(ZLetter.ToCString(),Graphic3d_Vertex(pZ.X(),pZ.Y(),pZ.Z()),1./81.);
+ Group->Text("Z",Graphic3d_Vertex(pZ.X(),pZ.Y(),pZ.Z()),1./81.);
Group->AddPrimitiveArray(aPrims);
{
if( !myPlaneStructure.IsNull() ) myPlaneStructure->Erase();
}
- if(Change) Update();
}
/*----------------------------------------------------------------------*/