mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0031909: Visualization, AIS_Trihedron - replace maps with arrays
Prs3d_DatumAspect, AIS_Trihedron - redundant maps have been replaced by explicitly sized arrays. AIS_Trihedron::myHasOwnDatumAspect - removed unused class field. Prs3d_DatumAttribute, Prs3d_DatumParts, Prs3d_DatumAxes - enumeration values have been renamed to have full name prefix. vzbufftrihedron - fixed no more necessary Quantity_Color -> Quantity_NameOfColor convertion.
This commit is contained in:
@@ -23,63 +23,39 @@ IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Prs3d_DatumAspect::Prs3d_DatumAspect()
|
||||
: myAxes (Prs3d_DA_XYZAxis),
|
||||
: myAxes (Prs3d_DatumAxes_XYZAxes),
|
||||
myToDrawLabels (Standard_True),
|
||||
myToDrawArrows (Standard_True)
|
||||
{
|
||||
Standard_Real aDefaultLength = 100.0; // default axis length, the same as in context
|
||||
Quantity_Color aDefaultColor(Quantity_NOC_LIGHTSTEELBLUE4); // default axis color
|
||||
const Standard_Real aDefaultLength = 100.0; // default axis length, the same as in context
|
||||
const Quantity_Color aDefaultColor (Quantity_NOC_LIGHTSTEELBLUE4); // default axis color
|
||||
|
||||
myAttributes.Bind (Prs3d_DA_XAxisLength, aDefaultLength);
|
||||
myAttributes.Bind (Prs3d_DA_YAxisLength, aDefaultLength);
|
||||
myAttributes.Bind (Prs3d_DA_ZAxisLength, aDefaultLength);
|
||||
myAttributes.Bind (Prs3d_DP_ShadingTubeRadiusPercent, 0.02);
|
||||
myAttributes.Bind (Prs3d_DP_ShadingConeRadiusPercent, 0.04);
|
||||
myAttributes.Bind (Prs3d_DP_ShadingConeLengthPercent, 0.1);
|
||||
myAttributes.Bind (Prs3d_DP_ShadingOriginRadiusPercent, 0.015);
|
||||
myAttributes.Bind (Prs3d_DP_ShadingNumberOfFacettes, 12.0);
|
||||
myAttributes[Prs3d_DatumAttribute_XAxisLength] = aDefaultLength;
|
||||
myAttributes[Prs3d_DatumAttribute_YAxisLength] = aDefaultLength;
|
||||
myAttributes[Prs3d_DatumAttribute_ZAxisLength] = aDefaultLength;
|
||||
myAttributes[Prs3d_DatumAttribute_ShadingTubeRadiusPercent] = 0.02;
|
||||
myAttributes[Prs3d_DatumAttribute_ShadingConeRadiusPercent] = 0.04;
|
||||
myAttributes[Prs3d_DatumAttribute_ShadingConeLengthPercent] = 0.1;
|
||||
myAttributes[Prs3d_DatumAttribute_ShadingOriginRadiusPercent] = 0.015;
|
||||
myAttributes[Prs3d_DatumAttribute_ShadingNumberOfFacettes] = 12.0;
|
||||
|
||||
Aspect_TypeOfLine aLineType = Aspect_TOL_SOLID;
|
||||
Standard_Real aWidth = 1.0;
|
||||
for (int aPartIter = Prs3d_DP_Origin; aPartIter <= Prs3d_DP_XOZAxis; ++aPartIter)
|
||||
for (int aPartIter = Prs3d_DatumParts_Origin; aPartIter <= Prs3d_DatumParts_XOZAxis; ++aPartIter)
|
||||
{
|
||||
const Prs3d_DatumParts aPart = (Prs3d_DatumParts )aPartIter;
|
||||
if (aPart != Prs3d_DP_Origin) // origin point is used only in shading mode
|
||||
if (aPart != Prs3d_DatumParts_Origin) // origin point is used only in shading mode
|
||||
{
|
||||
myLineAspects.Bind (aPart, new Prs3d_LineAspect (aDefaultColor, aLineType, aWidth));
|
||||
myLineAspects[aPart] = new Prs3d_LineAspect (aDefaultColor, Aspect_TOL_SOLID, 1.0);
|
||||
}
|
||||
|
||||
Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect();
|
||||
aShadingAspect->SetColor (aDefaultColor);
|
||||
myShadedAspects.Bind (aPart, aShadingAspect);
|
||||
myShadedAspects[aPart] = aShadingAspect;
|
||||
}
|
||||
myTextAspect = new Prs3d_TextAspect();
|
||||
myPointAspect = new Prs3d_PointAspect (Aspect_TOM_EMPTY, aDefaultColor, 1.0);
|
||||
myArrowAspect = new Prs3d_ArrowAspect();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : LineAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(Prs3d_LineAspect) Prs3d_DatumAspect::LineAspect (Prs3d_DatumParts thePart) const
|
||||
{
|
||||
Handle(Prs3d_LineAspect) aLineAspect;
|
||||
myLineAspects.Find (thePart, aLineAspect);
|
||||
return aLineAspect;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : ShadingAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(Prs3d_ShadingAspect) Prs3d_DatumAspect::ShadingAspect (Prs3d_DatumParts thePart) const
|
||||
{
|
||||
Handle(Prs3d_ShadingAspect) aShadingAspect;
|
||||
myShadedAspects.Find (thePart, aShadingAspect);
|
||||
return aShadingAspect;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDrawFirstAndSecondAxis
|
||||
// purpose :
|
||||
@@ -88,11 +64,11 @@ void Prs3d_DatumAspect::SetDrawFirstAndSecondAxis (Standard_Boolean theToDraw)
|
||||
{
|
||||
if (theToDraw)
|
||||
{
|
||||
myAxes = ((myAxes & Prs3d_DA_ZAxis) != 0 ? Prs3d_DA_XYZAxis : Prs3d_DA_XYAxis);
|
||||
myAxes = ((myAxes & Prs3d_DatumAxes_ZAxis) != 0 ? Prs3d_DatumAxes_XYZAxes : Prs3d_DatumAxes_XYAxes);
|
||||
}
|
||||
else
|
||||
{
|
||||
myAxes = Prs3d_DA_ZAxis;
|
||||
myAxes = Prs3d_DatumAxes_ZAxis;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,11 +80,11 @@ void Prs3d_DatumAspect::SetDrawThirdAxis (Standard_Boolean theToDraw)
|
||||
{
|
||||
if (theToDraw)
|
||||
{
|
||||
myAxes = ((myAxes & Prs3d_DA_XYAxis) != 0 ? Prs3d_DA_XYZAxis : Prs3d_DA_ZAxis);
|
||||
myAxes = ((myAxes & Prs3d_DatumAxes_XYAxes) != 0 ? Prs3d_DatumAxes_XYZAxes : Prs3d_DatumAxes_ZAxis);
|
||||
}
|
||||
else
|
||||
{
|
||||
myAxes = Prs3d_DA_XYAxis;
|
||||
myAxes = Prs3d_DatumAxes_XYAxes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,19 +96,19 @@ bool Prs3d_DatumAspect::DrawDatumPart (Prs3d_DatumParts thePart) const
|
||||
{
|
||||
switch (thePart)
|
||||
{
|
||||
case Prs3d_DP_Origin: return true;
|
||||
case Prs3d_DP_XAxis: return (myAxes & Prs3d_DA_XAxis) != 0;
|
||||
case Prs3d_DP_XArrow: return (myAxes & Prs3d_DA_XAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DP_YAxis: return (myAxes & Prs3d_DA_YAxis) != 0;
|
||||
case Prs3d_DP_YArrow: return (myAxes & Prs3d_DA_YAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DP_ZAxis: return (myAxes & Prs3d_DA_ZAxis) != 0;
|
||||
case Prs3d_DP_ZArrow: return (myAxes & Prs3d_DA_ZAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DP_XOYAxis: return DrawDatumPart (Prs3d_DP_XAxis)
|
||||
&& DrawDatumPart (Prs3d_DP_YAxis);
|
||||
case Prs3d_DP_YOZAxis: return DrawDatumPart (Prs3d_DP_YAxis)
|
||||
&& DrawDatumPart (Prs3d_DP_ZAxis);
|
||||
case Prs3d_DP_XOZAxis: return DrawDatumPart (Prs3d_DP_XAxis)
|
||||
&& DrawDatumPart (Prs3d_DP_ZAxis);
|
||||
case Prs3d_DatumParts_Origin: return true;
|
||||
case Prs3d_DatumParts_XAxis: return (myAxes & Prs3d_DatumAxes_XAxis) != 0;
|
||||
case Prs3d_DatumParts_XArrow: return (myAxes & Prs3d_DatumAxes_XAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DatumParts_YAxis: return (myAxes & Prs3d_DatumAxes_YAxis) != 0;
|
||||
case Prs3d_DatumParts_YArrow: return (myAxes & Prs3d_DatumAxes_YAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DatumParts_ZAxis: return (myAxes & Prs3d_DatumAxes_ZAxis) != 0;
|
||||
case Prs3d_DatumParts_ZArrow: return (myAxes & Prs3d_DatumAxes_ZAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DatumParts_XOYAxis: return DrawDatumPart (Prs3d_DatumParts_XAxis)
|
||||
&& DrawDatumPart (Prs3d_DatumParts_YAxis);
|
||||
case Prs3d_DatumParts_YOZAxis: return DrawDatumPart (Prs3d_DatumParts_YAxis)
|
||||
&& DrawDatumPart (Prs3d_DatumParts_ZAxis);
|
||||
case Prs3d_DatumParts_XOZAxis: return DrawDatumPart (Prs3d_DatumParts_XAxis)
|
||||
&& DrawDatumPart (Prs3d_DatumParts_ZAxis);
|
||||
default: break;
|
||||
}
|
||||
return false;
|
||||
@@ -146,9 +122,9 @@ Standard_Real Prs3d_DatumAspect::AxisLength (Prs3d_DatumParts thePart) const
|
||||
{
|
||||
switch (thePart)
|
||||
{
|
||||
case Prs3d_DP_XAxis: return myAttributes.Find (Prs3d_DA_XAxisLength);
|
||||
case Prs3d_DP_YAxis: return myAttributes.Find (Prs3d_DA_YAxisLength);
|
||||
case Prs3d_DP_ZAxis: return myAttributes.Find (Prs3d_DA_ZAxisLength);
|
||||
case Prs3d_DatumParts_XAxis: return myAttributes[Prs3d_DatumAttribute_XAxisLength];
|
||||
case Prs3d_DatumParts_YAxis: return myAttributes[Prs3d_DatumAttribute_YAxisLength];
|
||||
case Prs3d_DatumParts_ZAxis: return myAttributes[Prs3d_DatumAttribute_ZAxisLength];
|
||||
default: break;
|
||||
}
|
||||
return 0.0;
|
||||
@@ -162,12 +138,12 @@ Prs3d_DatumParts Prs3d_DatumAspect::ArrowPartForAxis (Prs3d_DatumParts thePart)
|
||||
{
|
||||
switch (thePart)
|
||||
{
|
||||
case Prs3d_DP_XAxis: return Prs3d_DP_XArrow;
|
||||
case Prs3d_DP_YAxis: return Prs3d_DP_YArrow;
|
||||
case Prs3d_DP_ZAxis: return Prs3d_DP_ZArrow;
|
||||
case Prs3d_DatumParts_XAxis: return Prs3d_DatumParts_XArrow;
|
||||
case Prs3d_DatumParts_YAxis: return Prs3d_DatumParts_YArrow;
|
||||
case Prs3d_DatumParts_ZAxis: return Prs3d_DatumParts_ZArrow;
|
||||
default: break;
|
||||
}
|
||||
return Prs3d_DP_None;
|
||||
return Prs3d_DatumParts_None;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@@ -34,14 +34,14 @@ class Prs3d_DatumAspect : public Prs3d_BasicAspect
|
||||
DEFINE_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
|
||||
public:
|
||||
|
||||
//! An empty framework to define the display of datums.
|
||||
//! An empty constructor.
|
||||
Standard_EXPORT Prs3d_DatumAspect();
|
||||
|
||||
//! Returns the right-handed coordinate system set in SetComponent.
|
||||
Standard_EXPORT Handle(Prs3d_LineAspect) LineAspect (Prs3d_DatumParts thePart) const;
|
||||
//! Returns line aspect for specified part.
|
||||
const Handle(Prs3d_LineAspect)& LineAspect (Prs3d_DatumParts thePart) const { return myLineAspects[thePart]; }
|
||||
|
||||
//! Returns the right-handed coordinate system set in SetComponent.
|
||||
Standard_EXPORT Handle(Prs3d_ShadingAspect) ShadingAspect (Prs3d_DatumParts thePart) const;
|
||||
//! Returns shading aspect for specified part.
|
||||
const Handle(Prs3d_ShadingAspect)& ShadingAspect (Prs3d_DatumParts thePart) const { return myShadedAspects[thePart]; }
|
||||
|
||||
//! Returns the text attributes for rendering labels.
|
||||
const Handle(Prs3d_TextAspect)& TextAspect() const { return myTextAspect; }
|
||||
@@ -61,38 +61,6 @@ public:
|
||||
//! Sets the arrow aspect of presentation
|
||||
void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect) { myArrowAspect = theAspect; }
|
||||
|
||||
//! Returns the attributes for display of the first axis.
|
||||
Standard_DEPRECATED("This method is deprecated - LineAspect() should be called instead")
|
||||
const Handle(Prs3d_LineAspect)& FirstAxisAspect() const { return myLineAspects.Find (Prs3d_DP_XAxis); }
|
||||
|
||||
//! Returns the attributes for display of the second axis.
|
||||
Standard_DEPRECATED("This method is deprecated - LineAspect() should be called instead")
|
||||
const Handle(Prs3d_LineAspect)& SecondAxisAspect() const { return myLineAspects.Find (Prs3d_DP_YAxis); }
|
||||
|
||||
//! Returns the attributes for display of the third axis.
|
||||
Standard_DEPRECATED("This method is deprecated - LineAspect() should be called instead")
|
||||
const Handle(Prs3d_LineAspect)& ThirdAxisAspect() const { return myLineAspects.Find (Prs3d_DP_ZAxis); }
|
||||
|
||||
//! Sets the DrawFirstAndSecondAxis attributes to active.
|
||||
Standard_DEPRECATED("This method is deprecated - SetDrawDatumAxes() should be called instead")
|
||||
Standard_EXPORT void SetDrawFirstAndSecondAxis (Standard_Boolean theToDraw);
|
||||
|
||||
//! Returns true if the first and second axes can be drawn.
|
||||
Standard_DEPRECATED("This method is deprecated - DatumAxes() should be called instead")
|
||||
Standard_Boolean DrawFirstAndSecondAxis() const
|
||||
{
|
||||
return (myAxes & Prs3d_DA_XAxis) != 0
|
||||
&& (myAxes & Prs3d_DA_YAxis) != 0;
|
||||
}
|
||||
|
||||
//! Sets the DrawThirdAxis attributes to active.
|
||||
Standard_DEPRECATED("This method is deprecated - SetDrawDatumAxes() should be called instead")
|
||||
Standard_EXPORT void SetDrawThirdAxis (Standard_Boolean theToDraw);
|
||||
|
||||
//! Returns true if the third axis can be drawn.
|
||||
Standard_DEPRECATED("This method is deprecated - DatumAxes() should be called instead")
|
||||
Standard_Boolean DrawThirdAxis() const { return (myAxes & Prs3d_DA_ZAxis) != 0; }
|
||||
|
||||
//! Returns true if the given part is used in axes of aspect
|
||||
Standard_EXPORT Standard_Boolean DrawDatumPart (Prs3d_DatumParts thePart) const;
|
||||
|
||||
@@ -102,40 +70,22 @@ public:
|
||||
//! Returns axes used in the datum aspect
|
||||
Prs3d_DatumAxes DatumAxes() const { return myAxes; }
|
||||
|
||||
//! Sets the attribute of the datum type
|
||||
void SetAttribute (Prs3d_DatumAttribute theType, const Standard_Real& theValue)
|
||||
{
|
||||
myAttributes.Bind (theType, theValue);
|
||||
}
|
||||
|
||||
//! Returns the attribute of the datum type
|
||||
Standard_Real Attribute (Prs3d_DatumAttribute theType) const
|
||||
{
|
||||
return myAttributes.Find (theType);
|
||||
}
|
||||
Standard_Real Attribute (Prs3d_DatumAttribute theType) const { return myAttributes[theType]; }
|
||||
|
||||
//! Sets the lengths of the three axes.
|
||||
void SetAxisLength (Standard_Real theL1, Standard_Real theL2, Standard_Real theL3)
|
||||
{
|
||||
myAttributes.Bind (Prs3d_DA_XAxisLength, theL1);
|
||||
myAttributes.Bind (Prs3d_DA_YAxisLength, theL2);
|
||||
myAttributes.Bind (Prs3d_DA_ZAxisLength, theL3);
|
||||
}
|
||||
//! Sets the attribute of the datum type
|
||||
void SetAttribute (Prs3d_DatumAttribute theType, const Standard_Real theValue) { myAttributes[theType] = theValue; }
|
||||
|
||||
//! Returns the length of the displayed first axis.
|
||||
Standard_EXPORT Standard_Real AxisLength (Prs3d_DatumParts thePart) const;
|
||||
|
||||
//! Returns the length of the displayed first axis.
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real FirstAxisLength() const { return myAttributes.Find (Prs3d_DA_XAxisLength); }
|
||||
|
||||
//! Returns the length of the displayed second axis.
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real SecondAxisLength() const { return myAttributes.Find (Prs3d_DA_YAxisLength); }
|
||||
|
||||
//! Returns the length of the displayed third axis.
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real ThirdAxisLength() const { return myAttributes.Find (Prs3d_DA_ZAxisLength); }
|
||||
//! Sets the lengths of the three axes.
|
||||
void SetAxisLength (Standard_Real theL1, Standard_Real theL2, Standard_Real theL3)
|
||||
{
|
||||
myAttributes[Prs3d_DatumAttribute_XAxisLength] = theL1;
|
||||
myAttributes[Prs3d_DatumAttribute_YAxisLength] = theL2;
|
||||
myAttributes[Prs3d_DatumAttribute_ZAxisLength] = theL3;
|
||||
}
|
||||
|
||||
//! @return true if axes labels are drawn; TRUE by default.
|
||||
Standard_Boolean ToDrawLabels() const { return myToDrawLabels; }
|
||||
@@ -156,18 +106,64 @@ public:
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
//! Returns the attributes for display of the first axis.
|
||||
Standard_DEPRECATED("This method is deprecated - LineAspect() should be called instead")
|
||||
const Handle(Prs3d_LineAspect)& FirstAxisAspect() const { return myLineAspects[Prs3d_DatumParts_XAxis]; }
|
||||
|
||||
//! Returns the attributes for display of the second axis.
|
||||
Standard_DEPRECATED("This method is deprecated - LineAspect() should be called instead")
|
||||
const Handle(Prs3d_LineAspect)& SecondAxisAspect() const { return myLineAspects[Prs3d_DatumParts_YAxis]; }
|
||||
|
||||
//! Returns the attributes for display of the third axis.
|
||||
Standard_DEPRECATED("This method is deprecated - LineAspect() should be called instead")
|
||||
const Handle(Prs3d_LineAspect)& ThirdAxisAspect() const { return myLineAspects[Prs3d_DatumParts_ZAxis]; }
|
||||
|
||||
//! Sets the DrawFirstAndSecondAxis attributes to active.
|
||||
Standard_DEPRECATED("This method is deprecated - SetDrawDatumAxes() should be called instead")
|
||||
Standard_EXPORT void SetDrawFirstAndSecondAxis (Standard_Boolean theToDraw);
|
||||
|
||||
//! Returns true if the first and second axes can be drawn.
|
||||
Standard_DEPRECATED("This method is deprecated - DatumAxes() should be called instead")
|
||||
Standard_Boolean DrawFirstAndSecondAxis() const
|
||||
{
|
||||
return (myAxes & Prs3d_DatumAxes_XAxis) != 0
|
||||
&& (myAxes & Prs3d_DatumAxes_YAxis) != 0;
|
||||
}
|
||||
|
||||
//! Sets the DrawThirdAxis attributes to active.
|
||||
Standard_DEPRECATED("This method is deprecated - SetDrawDatumAxes() should be called instead")
|
||||
Standard_EXPORT void SetDrawThirdAxis (Standard_Boolean theToDraw);
|
||||
|
||||
//! Returns true if the third axis can be drawn.
|
||||
Standard_DEPRECATED("This method is deprecated - DatumAxes() should be called instead")
|
||||
Standard_Boolean DrawThirdAxis() const { return (myAxes & Prs3d_DatumAxes_ZAxis) != 0; }
|
||||
|
||||
//! Returns the length of the displayed first axis.
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real FirstAxisLength() const { return myAttributes[Prs3d_DatumAttribute_XAxisLength]; }
|
||||
|
||||
//! Returns the length of the displayed second axis.
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real SecondAxisLength() const { return myAttributes[Prs3d_DatumAttribute_YAxisLength]; }
|
||||
|
||||
//! Returns the length of the displayed third axis.
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real ThirdAxisLength() const { return myAttributes[Prs3d_DatumAttribute_ZAxisLength]; }
|
||||
|
||||
private:
|
||||
Prs3d_DatumAxes myAxes;
|
||||
Standard_Boolean myToDrawLabels;
|
||||
Standard_Boolean myToDrawArrows;
|
||||
NCollection_DataMap<Prs3d_DatumAttribute, Standard_Real> myAttributes;
|
||||
|
||||
NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_ShadingAspect)> myShadedAspects;
|
||||
NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_LineAspect)> myLineAspects;
|
||||
Handle(Prs3d_ShadingAspect) myShadedAspects[Prs3d_DatumParts_NB];
|
||||
Handle(Prs3d_LineAspect) myLineAspects[Prs3d_DatumParts_NB];
|
||||
Handle(Prs3d_TextAspect) myTextAspect;
|
||||
Handle(Prs3d_PointAspect) myPointAspect;
|
||||
Handle(Prs3d_ArrowAspect) myArrowAspect;
|
||||
Standard_Real myAttributes[Prs3d_DatumAttribute_NB];
|
||||
Prs3d_DatumAxes myAxes;
|
||||
Standard_Boolean myToDrawLabels;
|
||||
Standard_Boolean myToDrawArrows;
|
||||
|
||||
Handle(Prs3d_TextAspect) myTextAspect;
|
||||
Handle(Prs3d_PointAspect) myPointAspect;
|
||||
Handle(Prs3d_ArrowAspect) myArrowAspect;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Prs3d_DatumAspect, Prs3d_BasicAspect)
|
||||
|
@@ -14,17 +14,28 @@
|
||||
#ifndef _Prs3d_DatumAttribute_HeaderFile
|
||||
#define _Prs3d_DatumAttribute_HeaderFile
|
||||
|
||||
//! Enumeration defining a part of datum aspect, see Prs3d_Datum.
|
||||
//! Enumeration defining a datum attribute, see Prs3d_Datum.
|
||||
enum Prs3d_DatumAttribute
|
||||
{
|
||||
Prs3d_DA_XAxisLength = 0,
|
||||
Prs3d_DA_YAxisLength,
|
||||
Prs3d_DA_ZAxisLength,
|
||||
Prs3d_DP_ShadingTubeRadiusPercent,
|
||||
Prs3d_DP_ShadingConeRadiusPercent,
|
||||
Prs3d_DP_ShadingConeLengthPercent,
|
||||
Prs3d_DP_ShadingOriginRadiusPercent,
|
||||
Prs3d_DP_ShadingNumberOfFacettes
|
||||
Prs3d_DatumAttribute_XAxisLength = 0,
|
||||
Prs3d_DatumAttribute_YAxisLength,
|
||||
Prs3d_DatumAttribute_ZAxisLength,
|
||||
Prs3d_DatumAttribute_ShadingTubeRadiusPercent,
|
||||
Prs3d_DatumAttribute_ShadingConeRadiusPercent,
|
||||
Prs3d_DatumAttribute_ShadingConeLengthPercent,
|
||||
Prs3d_DatumAttribute_ShadingOriginRadiusPercent,
|
||||
Prs3d_DatumAttribute_ShadingNumberOfFacettes,
|
||||
|
||||
// old aliases
|
||||
Prs3d_DA_XAxisLength = Prs3d_DatumAttribute_XAxisLength,
|
||||
Prs3d_DA_YAxisLength = Prs3d_DatumAttribute_YAxisLength,
|
||||
Prs3d_DA_ZAxisLength = Prs3d_DatumAttribute_ZAxisLength,
|
||||
Prs3d_DP_ShadingTubeRadiusPercent = Prs3d_DatumAttribute_ShadingTubeRadiusPercent,
|
||||
Prs3d_DP_ShadingConeRadiusPercent = Prs3d_DatumAttribute_ShadingConeRadiusPercent,
|
||||
Prs3d_DP_ShadingConeLengthPercent = Prs3d_DatumAttribute_ShadingConeLengthPercent,
|
||||
Prs3d_DP_ShadingOriginRadiusPercent = Prs3d_DatumAttribute_ShadingOriginRadiusPercent,
|
||||
Prs3d_DP_ShadingNumberOfFacettes = Prs3d_DatumAttribute_ShadingNumberOfFacettes
|
||||
};
|
||||
enum { Prs3d_DatumAttribute_NB = Prs3d_DatumAttribute_ShadingNumberOfFacettes + 1 };
|
||||
|
||||
#endif // _Prs3d_DatumAttribute_HeaderFile
|
||||
|
@@ -14,21 +14,30 @@
|
||||
#ifndef _Prs3d_DatumAxes_HeaderFile
|
||||
#define _Prs3d_DatumAxes_HeaderFile
|
||||
|
||||
//! Enumeration defining an axes used in datum aspect, see Prs3d_Datum.
|
||||
//! Enumeration defining axes used in datum aspect, see Prs3d_Datum.
|
||||
enum Prs3d_DatumAxes
|
||||
{
|
||||
Prs3d_DA_XAxis = 0x00000001, //!< X axis of the datum
|
||||
Prs3d_DA_YAxis = 0x00000002, //!< Y axis of the datum
|
||||
Prs3d_DA_ZAxis = 0x00000004, //!< Z axis of the datum
|
||||
Prs3d_DA_XYAxis = Prs3d_DA_XAxis
|
||||
| Prs3d_DA_YAxis, //!< XOY 2D axes
|
||||
Prs3d_DA_YZAxis = Prs3d_DA_YAxis
|
||||
| Prs3d_DA_ZAxis, //!< YOZ 2D axes
|
||||
Prs3d_DA_XZAxis = Prs3d_DA_XAxis
|
||||
| Prs3d_DA_ZAxis, //!< XOZ 2D axes
|
||||
Prs3d_DA_XYZAxis = Prs3d_DA_XAxis
|
||||
| Prs3d_DA_YAxis
|
||||
| Prs3d_DA_ZAxis //!< XYZ 3D axes
|
||||
Prs3d_DatumAxes_XAxis = 0x01, //!< X axis of the datum
|
||||
Prs3d_DatumAxes_YAxis = 0x02, //!< Y axis of the datum
|
||||
Prs3d_DatumAxes_ZAxis = 0x04, //!< Z axis of the datum
|
||||
Prs3d_DatumAxes_XYAxes = Prs3d_DatumAxes_XAxis
|
||||
| Prs3d_DatumAxes_YAxis, //!< XOY 2D axes
|
||||
Prs3d_DatumAxes_YZAxes = Prs3d_DatumAxes_YAxis
|
||||
| Prs3d_DatumAxes_ZAxis, //!< YOZ 2D axes
|
||||
Prs3d_DatumAxes_XZAxes = Prs3d_DatumAxes_XAxis
|
||||
| Prs3d_DatumAxes_ZAxis, //!< XOZ 2D axes
|
||||
Prs3d_DatumAxes_XYZAxes = Prs3d_DatumAxes_XAxis
|
||||
| Prs3d_DatumAxes_YAxis
|
||||
| Prs3d_DatumAxes_ZAxis, //!< XYZ 3D axes
|
||||
|
||||
// old aliases
|
||||
Prs3d_DA_XAxis = Prs3d_DatumAxes_XAxis,
|
||||
Prs3d_DA_YAxis = Prs3d_DatumAxes_YAxis,
|
||||
Prs3d_DA_ZAxis = Prs3d_DatumAxes_ZAxis,
|
||||
Prs3d_DA_XYAxis = Prs3d_DatumAxes_XYAxes,
|
||||
Prs3d_DA_YZAxis = Prs3d_DatumAxes_YZAxes,
|
||||
Prs3d_DA_XZAxis = Prs3d_DatumAxes_XZAxes,
|
||||
Prs3d_DA_XYZAxis = Prs3d_DatumAxes_XYZAxes
|
||||
};
|
||||
|
||||
#endif // _Prs3d_DatumParts_HeaderFile
|
||||
|
@@ -17,17 +17,31 @@
|
||||
//! Enumeration defining a part of datum aspect, see Prs3d_Datum.
|
||||
enum Prs3d_DatumParts
|
||||
{
|
||||
Prs3d_DP_Origin = 0,
|
||||
Prs3d_DP_XAxis,
|
||||
Prs3d_DP_YAxis,
|
||||
Prs3d_DP_ZAxis,
|
||||
Prs3d_DP_XArrow,
|
||||
Prs3d_DP_YArrow,
|
||||
Prs3d_DP_ZArrow,
|
||||
Prs3d_DP_XOYAxis,
|
||||
Prs3d_DP_YOZAxis,
|
||||
Prs3d_DP_XOZAxis,
|
||||
Prs3d_DP_None
|
||||
Prs3d_DatumParts_Origin = 0,
|
||||
Prs3d_DatumParts_XAxis,
|
||||
Prs3d_DatumParts_YAxis,
|
||||
Prs3d_DatumParts_ZAxis,
|
||||
Prs3d_DatumParts_XArrow,
|
||||
Prs3d_DatumParts_YArrow,
|
||||
Prs3d_DatumParts_ZArrow,
|
||||
Prs3d_DatumParts_XOYAxis,
|
||||
Prs3d_DatumParts_YOZAxis,
|
||||
Prs3d_DatumParts_XOZAxis,
|
||||
Prs3d_DatumParts_None,
|
||||
|
||||
// old aliases
|
||||
Prs3d_DP_Origin = Prs3d_DatumParts_Origin,
|
||||
Prs3d_DP_XAxis = Prs3d_DatumParts_XAxis,
|
||||
Prs3d_DP_YAxis = Prs3d_DatumParts_YAxis,
|
||||
Prs3d_DP_ZAxis = Prs3d_DatumParts_ZAxis,
|
||||
Prs3d_DP_XArrow = Prs3d_DatumParts_XArrow,
|
||||
Prs3d_DP_YArrow = Prs3d_DatumParts_YArrow,
|
||||
Prs3d_DP_ZArrow = Prs3d_DatumParts_ZArrow,
|
||||
Prs3d_DP_XOYAxis = Prs3d_DatumParts_XOYAxis,
|
||||
Prs3d_DP_YOZAxis = Prs3d_DatumParts_YOZAxis,
|
||||
Prs3d_DP_XOZAxis = Prs3d_DatumParts_XOZAxis,
|
||||
Prs3d_DP_None = Prs3d_DatumParts_None
|
||||
};
|
||||
enum { Prs3d_DatumParts_NB = Prs3d_DatumParts_None + 1 };
|
||||
|
||||
#endif // _Prs3d_DatumParts_HeaderFile
|
||||
|
@@ -1308,9 +1308,9 @@ bool Prs3d_Drawer::SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theP
|
||||
}
|
||||
if (myHasOwnDatumAspect)
|
||||
{
|
||||
setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DP_XAxis));
|
||||
setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DP_YAxis));
|
||||
setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DP_ZAxis));
|
||||
setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DatumParts_XAxis));
|
||||
setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DatumParts_YAxis));
|
||||
setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DatumParts_ZAxis));
|
||||
}
|
||||
setAspectProgram (theProgram, myHasOwnArrowAspect, myArrowAspect);
|
||||
return isUpdateNeeded;
|
||||
|
Reference in New Issue
Block a user