// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <Graphic3d_Group.hxx>
#include <gp_Ax2.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_CStructure.hxx>
-#include <Graphic3d_Group.hxx>
#include <Graphic3d_GroupDefinitionError.hxx>
#include <Graphic3d_ShaderProgram.hxx>
#include <Graphic3d_Structure.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Group,MMgt_TShared)
-#define MyContainsFacet myCBitFields.bool2
-
// =======================================================================
// function : Graphic3d_Group
// purpose :
// =======================================================================
Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& theStruct)
-: myIsClosed (Standard_False)
+: myStructure (theStruct.operator->()),
+ myIsClosed (false),
+ myContainsFacet (false)
{
- // A small commentary on the usage of This!
//
- // Graphic3d_Group is created in a structure. Graphic3d_Structure is a
- // manager of Graphic3d_Group. In the constructor of Graphic3d_Group
- // a method Add of Graphic3d_Structure is called. It allows adding
- // the instance of Graphic3d_Group in its manager. So there are 2 references
- // to <me> and everything works well.
- //
- // This () is the instance of the class, the current group
- //Handle(Graphic3d_Group) me = Handle(Graphic3d_Group)::DownCast (This());
-
- myStructure = theStruct.operator->();
+}
- MyContainsFacet = Standard_False;
+// =======================================================================
+// function : ~Graphic3d_Group
+// purpose :
+// =======================================================================
+Graphic3d_Group::~Graphic3d_Group()
+{
+ // tell graphics driver to clear internal resources of the group
+ Clear (Standard_False);
}
// =======================================================================
myBounds.Clear();
- if (MyContainsFacet)
+ if (myContainsFacet)
{
myStructure->GroupsWithFacet (-1);
- MyContainsFacet = Standard_False;
+ myContainsFacet = false;
}
// clear method could be used on Graphic3d_Structure destruction,
}
}
-// =======================================================================
-// function : Destroy
-// purpose :
-// =======================================================================
-void Graphic3d_Group::Destroy()
-{
- // tell graphics driver to clear internal resources of the group
- Clear (Standard_False);
-}
-
// =======================================================================
// function : Remove
// purpose :
return;
}
- if (MyContainsFacet)
+ if (myContainsFacet)
{
myStructure->GroupsWithFacet (-1);
- MyContainsFacet = Standard_False;
+ myContainsFacet = false;
}
myStructure->Remove (this);
|| myStructure->IsDeleted();
}
-// =======================================================================
-// function : ContainsFacet
-// purpose :
-// =======================================================================
-Standard_Boolean Graphic3d_Group::ContainsFacet() const
-{
- return MyContainsFacet;
-}
-
// =======================================================================
// function : IsEmpty
// purpose :
1.0f));
}
-// =======================================================================
-// function : MinMaxValues
-// purpose :
-// =======================================================================
-void Graphic3d_Group::MinMaxValues (Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin,
- Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax) const
-{
- MinMaxCoord (theXMin, theYMin, theZMin,
- theXMax, theYMax, theZMax);
-}
-
// =======================================================================
// function : Structure
// purpose :
}
// =======================================================================
-// function : MinMaxCoord
+// function : MinMaxValues
// purpose :
// =======================================================================
-void Graphic3d_Group::MinMaxCoord (Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin,
- Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax) const
+void Graphic3d_Group::MinMaxValues (Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin,
+ Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax) const
{
if (IsEmpty())
{
}
}
-// =======================================================================
-// function : PrimitivesAspect
-// purpose :
-// =======================================================================
-void Graphic3d_Group::PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine,
- const Handle(Graphic3d_AspectText3d)& theAspText,
- const Handle(Graphic3d_AspectMarker3d)& theAspMarker,
- const Handle(Graphic3d_AspectFillArea3d)& theAspFill) const
-{
- GroupPrimitivesAspect (theAspLine, theAspText, theAspMarker, theAspFill);
-}
-
// =======================================================================
// function : AddPrimitiveArray
// purpose :
return;
}
- if (!MyContainsFacet
+ if (!myContainsFacet
&& theType != Graphic3d_TOPA_POLYLINES
&& theType != Graphic3d_TOPA_SEGMENTS
&& theType != Graphic3d_TOPA_POINTS)
{
myStructure->GroupsWithFacet (1);
- MyContainsFacet = Standard_True;
+ myContainsFacet = true;
}
if (theToEvalMinMax)
const Graphic3d_VerticalTextAlignment theVta,
const Standard_Boolean theToEvalMinMax)
{
- const NCollection_String aText ((Standard_Utf16Char* )theText.ToExtString());
+ const NCollection_String aText (theText.ToExtString());
Text (aText.ToCString(), thePoint, theHeight, theAngle,
theTp, theHta, theVta, theToEvalMinMax);
}
const Standard_Boolean theToEvalMinMax,
const Standard_Boolean theHasOwnAnchor)
{
- const NCollection_String aText ((Standard_Utf16Char*)(theText.ToExtString()));
+ const NCollection_String aText (theText.ToExtString());
Text (aText.ToCString(),
theOrientation,
theHeight,
const Standard_Real theHeight,
const Standard_Boolean theToEvalMinMax)
{
- const NCollection_String aText ((Standard_Utf16Char* )theText.ToExtString());
+ const NCollection_String aText (theText.ToExtString());
Text (aText.ToCString(), thePoint, theHeight, 0.0,
Graphic3d_TP_RIGHT, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM, theToEvalMinMax);
}