mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
10 Commits
V7_8_1
...
CR0-ipdm_a
Author | SHA1 | Date | |
---|---|---|---|
|
75c9d4f7ee | ||
|
9799b909b0 | ||
|
c13b9c9d26 | ||
|
6fa0f312c6 | ||
|
c5e030c909 | ||
|
416d61f0f1 | ||
|
42a0649232 | ||
|
e9793362a7 | ||
|
d9f8b044ab | ||
|
bc5181f615 |
@@ -177,8 +177,11 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&,
|
||||
GeomAdaptor_Curve curv(myComponent);
|
||||
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
||||
}
|
||||
else {
|
||||
DsgPrs_XYZAxisPresentation::Add(aPresentation,myLineAspect,myDir,myVal,myText,myPfirst,myPlast);
|
||||
else
|
||||
{
|
||||
DsgPrs_XYZAxisPresentation::Add (aPresentation,myLineAspect,myDir,myVal,
|
||||
myDrawer->DatumAspect()->ToDrawLabels() ? myText : "",
|
||||
myPfirst, myPlast);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -776,9 +776,10 @@ Standard_Integer AIS_ColorScale::TextHeight (const TCollection_ExtendedString& t
|
||||
//=======================================================================
|
||||
void AIS_ColorScale::TextSize (const TCollection_ExtendedString& theText, const Standard_Integer theHeight, Standard_Integer& theWidth, Standard_Integer& theAscent, Standard_Integer& theDescent) const
|
||||
{
|
||||
const Handle(Graphic3d_CView)& aView = GetContext()->CurrentViewer()->ActiveView()->View();
|
||||
Standard_ShortReal aWidth(10.0), anAscent(1.0), aDescent(1.0);
|
||||
TCollection_AsciiString aText (theText.ToExtString(), '?');
|
||||
GetContext()->CurrentViewer()->Driver()->TextSize (aText.ToCString(),(Standard_ShortReal)theHeight,aWidth,anAscent,aDescent);
|
||||
GetContext()->CurrentViewer()->Driver()->TextSize (aView, aText.ToCString(), (Standard_ShortReal)theHeight, aWidth, anAscent, aDescent);
|
||||
theWidth = (Standard_Integer)aWidth;
|
||||
theAscent = (Standard_Integer)anAscent;
|
||||
theDescent = (Standard_Integer)aDescent;
|
||||
|
@@ -3014,3 +3014,26 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
|
||||
|
||||
theView->FitAll (aBndSelected, theMargin, theToUpdate);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetDefaultResolution (const unsigned int theResolution)
|
||||
{
|
||||
for (myMainVwr->InitDefinedViews(); myMainVwr->MoreDefinedViews(); myMainVwr->NextDefinedViews())
|
||||
{
|
||||
myMainVwr->DefinedView()->Redraw();
|
||||
}
|
||||
|
||||
myMainVwr->DefaultRenderingParams()->Resolution = theResolution;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDefaultRenderingParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Handle(Graphic3d_RenderingParams)& AIS_InteractiveContext::DefaultRenderingParams() const
|
||||
{
|
||||
return myMainVwr->DefaultRenderingParams();
|
||||
}
|
||||
|
@@ -1560,6 +1560,11 @@ public:
|
||||
//! Redraws immediate structures in all views of the viewer given taking into account its visibility.
|
||||
Standard_EXPORT void RedrawImmediate (const Handle(V3d_Viewer)& theViewer);
|
||||
|
||||
//! Sets a new resolution for default rendering params.
|
||||
Standard_EXPORT void SetDefaultResolution (const unsigned int theResolution);
|
||||
|
||||
//! Returns default rendering params.
|
||||
Standard_EXPORT const Handle(Graphic3d_RenderingParams)& DefaultRenderingParams() const;
|
||||
|
||||
friend class AIS_LocalContext;
|
||||
|
||||
|
@@ -1037,7 +1037,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
|
||||
anObjToClear.Add (anInteractive);
|
||||
}
|
||||
anOwner->State (0);
|
||||
if (theOwner == anObject->GlobalSelOwner())
|
||||
if (anOwner == anObject->GlobalSelOwner())
|
||||
{
|
||||
myObjects.ChangeFind (anObject)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
|
@@ -62,14 +62,13 @@
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
AIS_Trihedron::AIS_Trihedron(const Handle(Geom_Axis2Placement)& aComponent):
|
||||
myComponent(aComponent),
|
||||
myHasOwnSize(Standard_False),
|
||||
myHasOwnTextColor(Standard_False),
|
||||
myHasOwnArrowColor(Standard_False)
|
||||
|
||||
{ LoadSubObjects();}
|
||||
|
||||
|
||||
myComponent (aComponent),
|
||||
myHasOwnSize (Standard_False),
|
||||
myHasOwnTextColor (Standard_False),
|
||||
myHasOwnArrowColor (Standard_False)
|
||||
{
|
||||
LoadSubObjects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetComponent
|
||||
@@ -182,7 +181,10 @@ Standard_Real AIS_Trihedron::Size() const
|
||||
Handle(AIS_Axis) AIS_Trihedron::XAxis() const
|
||||
{
|
||||
Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[1]);
|
||||
if (anAxis.IsNull()) anAxis = new AIS_Axis (myComponent,AIS_TOAX_XAxis);
|
||||
if (anAxis.IsNull())
|
||||
{
|
||||
anAxis = new AIS_Axis (myComponent,AIS_TOAX_XAxis);
|
||||
}
|
||||
return anAxis;
|
||||
}
|
||||
|
||||
@@ -193,7 +195,11 @@ Handle(AIS_Axis) AIS_Trihedron::XAxis() const
|
||||
Handle(AIS_Axis) AIS_Trihedron::YAxis() const
|
||||
{
|
||||
Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[2]);
|
||||
if (anAxis.IsNull()) anAxis = new AIS_Axis (myComponent,AIS_TOAX_YAxis);
|
||||
if (anAxis.IsNull())
|
||||
{
|
||||
anAxis = new AIS_Axis (myComponent,AIS_TOAX_YAxis);
|
||||
}
|
||||
|
||||
return anAxis;
|
||||
}
|
||||
|
||||
@@ -204,7 +210,10 @@ Handle(AIS_Axis) AIS_Trihedron::YAxis() const
|
||||
Handle(AIS_Axis) AIS_Trihedron::Axis() const
|
||||
{
|
||||
Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[3]);
|
||||
if (anAxis.IsNull()) anAxis = new AIS_Axis (myComponent,AIS_TOAX_ZAxis);
|
||||
if (anAxis.IsNull())
|
||||
{
|
||||
anAxis = new AIS_Axis (myComponent,AIS_TOAX_ZAxis);
|
||||
}
|
||||
return anAxis;
|
||||
}
|
||||
|
||||
@@ -366,9 +375,7 @@ void AIS_Trihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelecti
|
||||
Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[anIdx]);
|
||||
Handle(Prs3d_Drawer) aDrawer = anAxis->Attributes();
|
||||
Handle(Prs3d_DatumAspect) aDatum = myDrawer->DatumAspect();
|
||||
aDrawer->DatumAspect()->SetAxisLength (aDatum->FirstAxisLength(),
|
||||
aDatum->SecondAxisLength(),
|
||||
aDatum->ThirdAxisLength());
|
||||
aDrawer->SetDatumAspect (aDatum);
|
||||
anAxisType = anAxis->TypeOfAxis();
|
||||
anAxis->SetAxis2Placement (myComponent, anAxisType);
|
||||
|
||||
|
@@ -168,9 +168,6 @@ public:
|
||||
//! Removes the non-default settings for width set in SetWidth.
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(AIS_Trihedron,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
@@ -189,6 +186,8 @@ private:
|
||||
|
||||
Standard_EXPORT void LoadSubObjects();
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Geom_Axis2Placement) myComponent;
|
||||
Handle(AIS_InteractiveObject) myShapes[7];
|
||||
Standard_Boolean myHasOwnSize;
|
||||
@@ -196,8 +195,6 @@ private:
|
||||
Quantity_NameOfColor myOwnTextColor;
|
||||
Standard_Boolean myHasOwnArrowColor;
|
||||
Quantity_NameOfColor myOwnArrowColor;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -45,6 +45,8 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
Quantity_Length anAxisLength;
|
||||
Quantity_Length anArrowAngle = theDrawer->ArrowAspect()->Angle();
|
||||
|
||||
const Standard_Boolean toDrawLabels = theDrawer->DatumAspect()->ToDrawLabels();
|
||||
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrims;
|
||||
if (aDatumAspect->DrawFirstAndSecondAxis())
|
||||
{
|
||||
@@ -61,7 +63,10 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
Prs3d_Arrow::Draw(thePresentation,aPoint1,aXDir,anArrowAngle,anAxisLength/10.);
|
||||
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
|
||||
Graphic3d_Vertex aVertex1(aPoint1.X(),aPoint1.Y(),aPoint1.Z());
|
||||
aGroup->Text(Standard_CString("X"), aVertex1,16.);
|
||||
if (toDrawLabels)
|
||||
{
|
||||
aGroup->Text (Standard_CString ("X"), aVertex1, 16.0);
|
||||
}
|
||||
|
||||
anAxisLength = aDatumAspect->SecondAxisLength();
|
||||
const gp_Pnt aPoint2(anOrigin.XYZ() + aYDir.XYZ()*anAxisLength);
|
||||
@@ -76,7 +81,10 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
Prs3d_Arrow::Draw(thePresentation,aPoint2,aYDir,anArrowAngle,anAxisLength/10.);
|
||||
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
|
||||
Graphic3d_Vertex aVertex2(aPoint2.X(),aPoint2.Y(),aPoint2.Z());
|
||||
aGroup->Text(Standard_CString("Y"), aVertex2,16.);
|
||||
if (toDrawLabels)
|
||||
{
|
||||
aGroup->Text (Standard_CString ("Y"), aVertex2, 16.0);
|
||||
}
|
||||
}
|
||||
if (aDatumAspect->DrawThirdAxis())
|
||||
{
|
||||
@@ -93,7 +101,9 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
Prs3d_Arrow::Draw(thePresentation,aPoint3,aZDir,anArrowAngle,anAxisLength/10.);
|
||||
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
|
||||
Graphic3d_Vertex aVertex3(aPoint3.X(),aPoint3.Y(),aPoint3.Z());
|
||||
aGroup->Text(Standard_CString("Z"), aVertex3,16.);
|
||||
if (toDrawLabels)
|
||||
{
|
||||
aGroup->Text (Standard_CString ("Z"), aVertex3, 16.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -112,7 +112,7 @@ public:
|
||||
//! @return true on success
|
||||
Standard_EXPORT bool Init (const NCollection_String& theFontPath,
|
||||
const unsigned int thePointSize,
|
||||
const unsigned int theResolution = 72);
|
||||
const unsigned int theResolution);
|
||||
|
||||
//! Initialize the font.
|
||||
//! @param theFontName the font name
|
||||
|
@@ -28,6 +28,7 @@ Graphic3d_CView::Graphic3d_CView (const Handle(Graphic3d_StructureManager)& theM
|
||||
myVisualization (Graphic3d_TOV_WIREFRAME)
|
||||
{
|
||||
myId = myStructureManager->Identification (this);
|
||||
myRenderParams = new Graphic3d_RenderingParams();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -401,53 +402,6 @@ void Graphic3d_CView::DisplayedStructures (Graphic3d_MapOfStructure& theStructur
|
||||
}
|
||||
}
|
||||
|
||||
//! Auxiliary method for MinMaxValues() method
|
||||
inline void addStructureBndBox (const Handle(Graphic3d_Structure)& theStruct,
|
||||
const Standard_Boolean theToIgnoreInfiniteFlag,
|
||||
Bnd_Box& theBndBox)
|
||||
{
|
||||
if (!theStruct->IsVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (theStruct->IsInfinite()
|
||||
&& !theToIgnoreInfiniteFlag)
|
||||
{
|
||||
// XMin, YMin .... ZMax are initialized by means of infinite line data
|
||||
const Bnd_Box aBox = theStruct->MinMaxValues (Standard_False);
|
||||
if (!aBox.IsWhole()
|
||||
&& !aBox.IsVoid())
|
||||
{
|
||||
theBndBox.Add (aBox);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Only non-empty and non-infinite structures
|
||||
// are taken into account for calculation of MinMax
|
||||
if (theStruct->IsEmpty()
|
||||
|| theStruct->TransformPersistenceMode() != Graphic3d_TMF_None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// "FitAll" operation ignores object with transform persistence parameter
|
||||
const Bnd_Box aBox = theStruct->MinMaxValues (theToIgnoreInfiniteFlag);
|
||||
|
||||
// To prevent float overflow at camera parameters calculation and further
|
||||
// rendering, bounding boxes with at least one vertex coordinate out of
|
||||
// float range are skipped by view fit algorithms
|
||||
if (Abs (aBox.CornerMax().X()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMax().Y()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMax().Z()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMin().X()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMin().Y()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMin().Z()) >= ShortRealLast())
|
||||
return;
|
||||
|
||||
theBndBox.Add (aBox);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : MinMaxValues
|
||||
// purpose :
|
||||
@@ -472,20 +426,69 @@ Bnd_Box Graphic3d_CView::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
|
||||
{
|
||||
Bnd_Box aResult;
|
||||
const Standard_Integer aViewId = Identification();
|
||||
|
||||
Handle(Graphic3d_Camera) aCamera = Camera();
|
||||
Standard_Integer aWinWidth = 0;
|
||||
Standard_Integer aWinHeight = 0;
|
||||
if (IsDefined())
|
||||
{
|
||||
Window()->Size (aWinWidth, aWinHeight);
|
||||
}
|
||||
|
||||
for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (theSet); aStructIter.More(); aStructIter.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Structure)& aStructure = aStructIter.Key();
|
||||
if (!aStructIter.Value()->IsVisible())
|
||||
if (!aStructure->IsVisible() || aStructure->IsEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (!aStructIter.Value()->CStructure()->ViewAffinity.IsNull()
|
||||
&& !aStructIter.Value()->CStructure()->ViewAffinity->IsVisible (aViewId))
|
||||
else if (!aStructure->CStructure()->ViewAffinity.IsNull()
|
||||
&& !aStructure->CStructure()->ViewAffinity->IsVisible (aViewId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
addStructureBndBox (aStructure, theToIgnoreInfiniteFlag, aResult);
|
||||
// "FitAll" operation ignores object with transform persistence parameter
|
||||
if (aStructure->TransformPersistence().Flags)
|
||||
{
|
||||
// Panning and 2d persistence apply changes to projection or/and its translation components.
|
||||
// It makes them incompatible with z-fitting algorithm. Ignored by now.
|
||||
if (!theToIgnoreInfiniteFlag ||
|
||||
(aStructure->TransformPersistence().Flags & Graphic3d_TMF_2d) ||
|
||||
(aStructure->TransformPersistence().Flags & Graphic3d_TMF_PanPers))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Bnd_Box aBox = aStructure->MinMaxValues (theToIgnoreInfiniteFlag);
|
||||
|
||||
if (aBox.IsWhole() || aBox.IsVoid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aStructure->TransformPersistence().Flags != Graphic3d_TMF_None)
|
||||
{
|
||||
const Graphic3d_Mat4d& aProjectionMat = aCamera->ProjectionMatrix();
|
||||
const Graphic3d_Mat4d& aWorldViewMat = aCamera->OrientationMatrix();
|
||||
aStructure->TransformPersistence().Apply (aProjectionMat, aWorldViewMat, aWinWidth, aWinHeight, aBox);
|
||||
}
|
||||
|
||||
// To prevent float overflow at camera parameters calculation and further
|
||||
// rendering, bounding boxes with at least one vertex coordinate out of
|
||||
// float range are skipped by view fit algorithms
|
||||
if (Abs (aBox.CornerMax().X()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMax().Y()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMax().Z()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMin().X()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMin().Y()) >= ShortRealLast() ||
|
||||
Abs (aBox.CornerMin().Z()) >= ShortRealLast())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
aResult.Add (aBox);
|
||||
}
|
||||
return aResult;
|
||||
}
|
||||
|
@@ -396,10 +396,10 @@ public:
|
||||
Standard_EXPORT virtual void CopySettings (const Handle(Graphic3d_CView)& theOther);
|
||||
|
||||
//! Returns current rendering parameters and effect settings.
|
||||
const Graphic3d_RenderingParams& RenderingParams() const { return myRenderParams; }
|
||||
const Handle(Graphic3d_RenderingParams)& RenderingParams() const { return myRenderParams; }
|
||||
|
||||
//! Returns reference to current rendering parameters and effect settings.
|
||||
Graphic3d_RenderingParams& ChangeRenderingParams() { return myRenderParams; }
|
||||
Handle(Graphic3d_RenderingParams)& ChangeRenderingParams() { return myRenderParams; }
|
||||
|
||||
//! Returns true if anti-aliasing is enabled for the view.
|
||||
virtual Standard_Boolean IsAntialiasingEnabled() const = 0;
|
||||
@@ -571,7 +571,7 @@ protected:
|
||||
protected:
|
||||
|
||||
Standard_Integer myId;
|
||||
Graphic3d_RenderingParams myRenderParams;
|
||||
Handle(Graphic3d_RenderingParams) myRenderParams;
|
||||
Handle(Graphic3d_StructureManager) myStructureManager;
|
||||
Graphic3d_SequenceOfStructure myStructsToCompute;
|
||||
Graphic3d_SequenceOfStructure myStructsComputed;
|
||||
|
@@ -99,8 +99,13 @@ public:
|
||||
|
||||
virtual Standard_ShortReal DefaultTextHeight() const = 0;
|
||||
|
||||
//! call_togl_textsize2d
|
||||
virtual void TextSize (const Standard_CString AText, const Standard_ShortReal AHeight, Standard_ShortReal& AWidth, Standard_ShortReal& AnAscent, Standard_ShortReal& ADescent) const = 0;
|
||||
//! Computes text width.
|
||||
virtual void TextSize (const Handle(Graphic3d_CView)& theView,
|
||||
const Standard_CString theText,
|
||||
const Standard_ShortReal theHeight,
|
||||
Standard_ShortReal& theWidth,
|
||||
Standard_ShortReal& theAscent,
|
||||
Standard_ShortReal& theDescent) const = 0;
|
||||
|
||||
//! Add a new top-level z layer with ID <theLayerId> for
|
||||
//! the view. Z layers allow drawing structures in higher layers
|
||||
|
@@ -22,9 +22,11 @@
|
||||
#include <Graphic3d_Vec4.hxx>
|
||||
|
||||
//! Helper class to store rendering parameters.
|
||||
class Graphic3d_RenderingParams
|
||||
class Graphic3d_RenderingParams : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
//! Default pixels density.
|
||||
static const unsigned int THE_DEFAULT_RESOLUTION = 72u;
|
||||
|
||||
//! Default number of samples per pixel.
|
||||
static const Standard_Integer THE_DEFAULT_SPP = 1;
|
||||
@@ -60,7 +62,9 @@ public:
|
||||
|
||||
StereoMode (Graphic3d_StereoMode_QuadBuffer),
|
||||
AnaglyphFilter (Anaglyph_RedCyan_Optimized),
|
||||
ToReverseStereo (Standard_False)
|
||||
ToReverseStereo (Standard_False),
|
||||
|
||||
Resolution (THE_DEFAULT_RESOLUTION)
|
||||
{
|
||||
const Graphic3d_Vec4 aZero (0.0f, 0.0f, 0.0f, 0.0f);
|
||||
AnaglyphLeft .SetRow (0, Graphic3d_Vec4 (1.0f, 0.0f, 0.0f, 0.0f));
|
||||
@@ -93,6 +97,16 @@ public:
|
||||
Graphic3d_Mat4 AnaglyphRight; //!< right anaglyph filter (in normalized colorspace), Color = AnaglyphRight * theColorRight + AnaglyphLeft * theColorLeft;
|
||||
Standard_Boolean ToReverseStereo; //!< flag to reverse stereo pair, FALSE by default
|
||||
|
||||
unsigned int Resolution; //!< Pixels density (PPI), defines scaling factor for parameters like text size
|
||||
//!< (when defined in screen-space units rather than in 3D) to be properly displayed
|
||||
//!< on device (screen / printer). 72 is default value.
|
||||
//!< Note that using difference resolution in different Views in same Viewer
|
||||
//!< will lead to performance regression (for example, text will be recreated every time).
|
||||
|
||||
public:
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_RenderingParams, Standard_Transient)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_RenderingParams, Standard_Transient)
|
||||
|
||||
#endif // _Graphic3d_RenderingParams_HeaderFile
|
||||
|
@@ -472,11 +472,12 @@ void OpenGl_GraphicDriver::SetBuffersNoSwap (const Standard_Boolean theIsNoSwap)
|
||||
// function : TextSize
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void OpenGl_GraphicDriver::TextSize (const Standard_CString theText,
|
||||
const Standard_ShortReal theHeight,
|
||||
Standard_ShortReal& theWidth,
|
||||
Standard_ShortReal& theAscent,
|
||||
Standard_ShortReal& theDescent) const
|
||||
void OpenGl_GraphicDriver::TextSize (const Handle(Graphic3d_CView)& theView,
|
||||
const Standard_CString theText,
|
||||
const Standard_ShortReal theHeight,
|
||||
Standard_ShortReal& theWidth,
|
||||
Standard_ShortReal& theAscent,
|
||||
Standard_ShortReal& theDescent) const
|
||||
{
|
||||
const Handle(OpenGl_Context)& aCtx = GetSharedContext();
|
||||
if (aCtx.IsNull())
|
||||
@@ -506,7 +507,7 @@ void OpenGl_GraphicDriver::TextSize (const Standard_CString theText,
|
||||
aTextAspect.SetAspect(aDefaultContextText);
|
||||
TCollection_ExtendedString anExtText = theText;
|
||||
NCollection_String aText = (Standard_Utf16Char* )anExtText.ToExtString();
|
||||
OpenGl_Text::StringSize (aCtx, aText, aTextAspect, aTextParam, theWidth, theAscent, theDescent);
|
||||
OpenGl_Text::StringSize(aCtx, aText, aTextAspect, aTextParam, theView->RenderingParams()->Resolution, theWidth, theAscent, theDescent);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -132,7 +132,12 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT void TextSize (const Standard_CString AText,const Standard_ShortReal AHeight,Standard_ShortReal& AWidth,Standard_ShortReal& AnAscent,Standard_ShortReal& ADescent) const;
|
||||
Standard_EXPORT void TextSize (const Handle(Graphic3d_CView)& theView,
|
||||
const Standard_CString theText,
|
||||
const Standard_ShortReal theHeight,
|
||||
Standard_ShortReal& theWidth,
|
||||
Standard_ShortReal& theAscent,
|
||||
Standard_ShortReal& theDescent) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer InquirePlaneLimit();
|
||||
|
||||
|
@@ -163,7 +163,8 @@ public:
|
||||
|| IsForHighlight
|
||||
|| IsMutable
|
||||
|| Is2dText
|
||||
|| TransformPersistence.Flags != 0;
|
||||
|| (TransformPersistence.Flags & Graphic3d_TMF_2d) != 0
|
||||
|| (TransformPersistence.Flags & Graphic3d_TMF_PanPers) != 0;
|
||||
}
|
||||
|
||||
//! This method releases GL resources without actual elements destruction.
|
||||
|
@@ -342,6 +342,7 @@ void OpenGl_Text::StringSize (const Handle(OpenGl_Context)& theCtx,
|
||||
const NCollection_String& theText,
|
||||
const OpenGl_AspectText& theTextAspect,
|
||||
const OpenGl_TextParam& theParams,
|
||||
const unsigned int theResolution,
|
||||
Standard_ShortReal& theWidth,
|
||||
Standard_ShortReal& theAscent,
|
||||
Standard_ShortReal& theDescent)
|
||||
@@ -349,8 +350,8 @@ void OpenGl_Text::StringSize (const Handle(OpenGl_Context)& theCtx,
|
||||
theWidth = 0.0f;
|
||||
theAscent = 0.0f;
|
||||
theDescent = 0.0f;
|
||||
const TCollection_AsciiString aFontKey = FontKey (theTextAspect, theParams.Height);
|
||||
Handle(OpenGl_Font) aFont = FindFont (theCtx, theTextAspect, theParams.Height, aFontKey);
|
||||
const TCollection_AsciiString aFontKey = FontKey (theTextAspect, theParams.Height, theResolution);
|
||||
Handle(OpenGl_Font) aFont = FindFont (theCtx, theTextAspect, theParams.Height, theResolution, aFontKey);
|
||||
if (aFont.IsNull() || !aFont->IsValid())
|
||||
{
|
||||
return;
|
||||
@@ -426,7 +427,8 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
aCtx,
|
||||
*aTextAspect,
|
||||
*theWorkspace->HighlightColor,
|
||||
*theWorkspace->HighlightColor);
|
||||
*theWorkspace->HighlightColor,
|
||||
theWorkspace->View()->RenderingParams()->Resolution);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -434,7 +436,8 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
aCtx,
|
||||
*aTextAspect,
|
||||
aTextAspect->Color(),
|
||||
aTextAspect->SubtitleColor());
|
||||
aTextAspect->SubtitleColor(),
|
||||
theWorkspace->View()->RenderingParams()->Resolution);
|
||||
}
|
||||
|
||||
aCtx->BindProgram (NULL);
|
||||
@@ -458,9 +461,10 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
// =======================================================================
|
||||
void OpenGl_Text::Render (const Handle(OpenGl_PrinterContext)& thePrintCtx,
|
||||
const Handle(OpenGl_Context)& theCtx,
|
||||
const OpenGl_AspectText& theTextAspect) const
|
||||
const OpenGl_AspectText& theTextAspect,
|
||||
const unsigned int theResolution) const
|
||||
{
|
||||
render (thePrintCtx, theCtx, theTextAspect, theTextAspect.Color(), theTextAspect.SubtitleColor());
|
||||
render (thePrintCtx, theCtx, theTextAspect, theTextAspect.Color(), theTextAspect.SubtitleColor(), theResolution);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -609,11 +613,13 @@ void OpenGl_Text::drawText (const Handle(OpenGl_PrinterContext)& ,
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TCollection_AsciiString OpenGl_Text::FontKey (const OpenGl_AspectText& theAspect,
|
||||
const Standard_Integer theHeight)
|
||||
const Standard_Integer theHeight,
|
||||
const unsigned int theResolution)
|
||||
{
|
||||
const Font_FontAspect anAspect = (theAspect.FontAspect() != Font_FA_Undefined) ? theAspect.FontAspect() : Font_FA_Regular;
|
||||
return theAspect.FontName()
|
||||
+ TCollection_AsciiString(":") + Standard_Integer(anAspect)
|
||||
+ TCollection_AsciiString(":") + Standard_Integer(theResolution)
|
||||
+ TCollection_AsciiString(":") + theHeight;
|
||||
}
|
||||
|
||||
@@ -624,6 +630,7 @@ TCollection_AsciiString OpenGl_Text::FontKey (const OpenGl_AspectText& theAspect
|
||||
Handle(OpenGl_Font) OpenGl_Text::FindFont (const Handle(OpenGl_Context)& theCtx,
|
||||
const OpenGl_AspectText& theAspect,
|
||||
const Standard_Integer theHeight,
|
||||
const unsigned int theResolution,
|
||||
const TCollection_AsciiString theKey)
|
||||
{
|
||||
Handle(OpenGl_Font) aFont;
|
||||
@@ -643,7 +650,7 @@ Handle(OpenGl_Font) OpenGl_Text::FindFont (const Handle(OpenGl_Context)& theCtx,
|
||||
{
|
||||
aFontFt = new Font_FTFont (NULL);
|
||||
|
||||
if (aFontFt->Init (aRequestedFont->FontPath()->ToCString(), theHeight))
|
||||
if (aFontFt->Init (aRequestedFont->FontPath()->ToCString(), theHeight, theResolution))
|
||||
{
|
||||
aFont = new OpenGl_Font (aFontFt, theKey);
|
||||
if (!aFont->Init (theCtx))
|
||||
@@ -693,14 +700,17 @@ void OpenGl_Text::render (const Handle(OpenGl_PrinterContext)& thePrintCtx,
|
||||
const Handle(OpenGl_Context)& theCtx,
|
||||
const OpenGl_AspectText& theTextAspect,
|
||||
const TEL_COLOUR& theColorText,
|
||||
const TEL_COLOUR& theColorSubs) const
|
||||
const TEL_COLOUR& theColorSubs,
|
||||
const unsigned int theResolution) const
|
||||
{
|
||||
if (myString.IsEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const TCollection_AsciiString aFontKey = FontKey (theTextAspect, myParams.Height);
|
||||
// Note that using difference resolution in different Views in same Viewer
|
||||
// will lead to performance regression (for example, text will be recreated every time).
|
||||
const TCollection_AsciiString aFontKey = FontKey (theTextAspect, myParams.Height, theResolution);
|
||||
if (!myFont.IsNull()
|
||||
&& !myFont->ResourceKey().IsEqual (aFontKey))
|
||||
{
|
||||
@@ -710,7 +720,7 @@ void OpenGl_Text::render (const Handle(OpenGl_PrinterContext)& thePrintCtx,
|
||||
|
||||
if (myFont.IsNull())
|
||||
{
|
||||
myFont = FindFont (theCtx, theTextAspect, myParams.Height, aFontKey);
|
||||
myFont = FindFont (theCtx, theTextAspect, myParams.Height, theResolution, aFontKey);
|
||||
}
|
||||
if (!myFont->WasInitialized())
|
||||
{
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <Graphic3d_Vertex.hxx>
|
||||
#include <Graphic3d_HorizontalTextAlignment.hxx>
|
||||
#include <Graphic3d_RenderingParams.hxx>
|
||||
#include <Graphic3d_VerticalTextAlignment.hxx>
|
||||
|
||||
#include <gp_Ax2.hxx>
|
||||
@@ -75,12 +76,14 @@ public: //! @name methods for compatibility with layers
|
||||
|
||||
//! Create key for shared resource
|
||||
Standard_EXPORT static TCollection_AsciiString FontKey (const OpenGl_AspectText& theAspect,
|
||||
const Standard_Integer theHeight);
|
||||
const Standard_Integer theHeight,
|
||||
const unsigned int theResolution);
|
||||
|
||||
//! Find shared resource for specified font or initialize new one
|
||||
Standard_EXPORT static Handle(OpenGl_Font) FindFont (const Handle(OpenGl_Context)& theCtx,
|
||||
const OpenGl_AspectText& theAspect,
|
||||
const Standard_Integer theHeight,
|
||||
const unsigned int theResolution,
|
||||
const TCollection_AsciiString theKey);
|
||||
|
||||
//! Compute text width
|
||||
@@ -88,6 +91,7 @@ public: //! @name methods for compatibility with layers
|
||||
const NCollection_String& theText,
|
||||
const OpenGl_AspectText& theTextAspect,
|
||||
const OpenGl_TextParam& theParams,
|
||||
const unsigned int theResolution,
|
||||
Standard_ShortReal& theWidth,
|
||||
Standard_ShortReal& theAscent,
|
||||
Standard_ShortReal& theDescent);
|
||||
@@ -101,7 +105,8 @@ public: //! @name methods for compatibility with layers
|
||||
//! Perform rendering
|
||||
Standard_EXPORT void Render (const Handle(OpenGl_PrinterContext)& thePrintCtx,
|
||||
const Handle(OpenGl_Context)& theCtx,
|
||||
const OpenGl_AspectText& theTextAspect) const;
|
||||
const OpenGl_AspectText& theTextAspect,
|
||||
const unsigned int theResolution = Graphic3d_RenderingParams::THE_DEFAULT_RESOLUTION) const;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -132,7 +137,8 @@ private:
|
||||
const Handle(OpenGl_Context)& theCtx,
|
||||
const OpenGl_AspectText& theTextAspect,
|
||||
const TEL_COLOUR& theColorText,
|
||||
const TEL_COLOUR& theColorSubs) const;
|
||||
const TEL_COLOUR& theColorSubs,
|
||||
const unsigned int theResolution) const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -1266,9 +1266,9 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context
|
||||
}
|
||||
}
|
||||
|
||||
if (myRenderParams.RaytracingDepth != myRaytraceParameters.NbBounces)
|
||||
if (myRenderParams->RaytracingDepth != myRaytraceParameters.NbBounces)
|
||||
{
|
||||
myRaytraceParameters.NbBounces = myRenderParams.RaytracingDepth;
|
||||
myRaytraceParameters.NbBounces = myRenderParams->RaytracingDepth;
|
||||
aToRebuildShaders = Standard_True;
|
||||
}
|
||||
|
||||
@@ -1278,15 +1278,15 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context
|
||||
aToRebuildShaders = Standard_True;
|
||||
}
|
||||
|
||||
if (myRenderParams.IsTransparentShadowEnabled != myRaytraceParameters.TransparentShadows)
|
||||
if (myRenderParams->IsTransparentShadowEnabled != myRaytraceParameters.TransparentShadows)
|
||||
{
|
||||
myRaytraceParameters.TransparentShadows = myRenderParams.IsTransparentShadowEnabled;
|
||||
myRaytraceParameters.TransparentShadows = myRenderParams->IsTransparentShadowEnabled;
|
||||
aToRebuildShaders = Standard_True;
|
||||
}
|
||||
|
||||
if (myRenderParams.IsGlobalIlluminationEnabled != myRaytraceParameters.GlobalIllumination)
|
||||
if (myRenderParams->IsGlobalIlluminationEnabled != myRaytraceParameters.GlobalIllumination)
|
||||
{
|
||||
myRaytraceParameters.GlobalIllumination = myRenderParams.IsGlobalIlluminationEnabled;
|
||||
myRaytraceParameters.GlobalIllumination = myRenderParams->IsGlobalIlluminationEnabled;
|
||||
aToRebuildShaders = Standard_True;
|
||||
}
|
||||
|
||||
@@ -1344,7 +1344,7 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context
|
||||
return safeFailBack ("Ray-tracing requires EXT_framebuffer_blit extension", theGlContext);
|
||||
}
|
||||
|
||||
myRaytraceParameters.NbBounces = myRenderParams.RaytracingDepth;
|
||||
myRaytraceParameters.NbBounces = myRenderParams->RaytracingDepth;
|
||||
|
||||
TCollection_AsciiString aFolder = Graphic3d_ShaderProgram::ShadersFolder();
|
||||
|
||||
@@ -2238,14 +2238,14 @@ Standard_Boolean OpenGl_View::setUniformState (const OpenGl_Vec3* the
|
||||
|
||||
// Set run-time rendering options
|
||||
theProgram->SetUniform (theGlContext,
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uShadowsEnabled], myRenderParams.IsShadowEnabled ? 1 : 0);
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uShadowsEnabled], myRenderParams->IsShadowEnabled ? 1 : 0);
|
||||
theProgram->SetUniform (theGlContext,
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uReflectEnabled], myRenderParams.IsReflectionEnabled ? 1 : 0);
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uReflectEnabled], myRenderParams->IsReflectionEnabled ? 1 : 0);
|
||||
|
||||
if (myRenderParams.IsGlobalIlluminationEnabled)
|
||||
if (myRenderParams->IsGlobalIlluminationEnabled)
|
||||
{
|
||||
theProgram->SetUniform (theGlContext,
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uBlockedRngEnabled], myRenderParams.CoherentPathTracingMode ? 1 : 0);
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uBlockedRngEnabled], myRenderParams->CoherentPathTracingMode ? 1 : 0);
|
||||
}
|
||||
|
||||
// Set array of 64-bit texture handles
|
||||
@@ -2279,7 +2279,7 @@ Standard_Boolean OpenGl_View::setUniformState (const OpenGl_Vec3* the
|
||||
}
|
||||
|
||||
theProgram->SetUniform (theGlContext,
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uSphereMapForBack], myRenderParams.UseEnvironmentMapBackground ? 1 : 0);
|
||||
myUniformLocations[theProgramId][OpenGl_RT_uSphereMapForBack], myRenderParams->UseEnvironmentMapBackground ? 1 : 0);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -2373,7 +2373,7 @@ Standard_Boolean OpenGl_View::runRaytraceShaders (const Standard_Integer
|
||||
|
||||
aRenderFramebuffer->BindBuffer (theGlContext);
|
||||
}
|
||||
else if (myRenderParams.IsAntialiasingEnabled) // if 2-pass ray-tracing is used
|
||||
else if (myRenderParams->IsAntialiasingEnabled) // if 2-pass ray-tracing is used
|
||||
{
|
||||
myRaytraceFBO1->BindBuffer (theGlContext);
|
||||
|
||||
@@ -2429,7 +2429,7 @@ Standard_Boolean OpenGl_View::runRaytraceShaders (const Standard_Integer
|
||||
|
||||
++myAccumFrames;
|
||||
}
|
||||
else if (myRenderParams.IsAntialiasingEnabled)
|
||||
else if (myRenderParams->IsAntialiasingEnabled)
|
||||
{
|
||||
myRaytraceFBO1->ColorTexture()->Bind (theGlContext, GL_TEXTURE0 + OpenGl_RT_FsaaInputTexture);
|
||||
|
||||
|
@@ -251,7 +251,7 @@ void OpenGl_View::DrawBackground (const Handle(OpenGl_Workspace)& theWorkspace)
|
||||
//=======================================================================
|
||||
void OpenGl_View::Redraw()
|
||||
{
|
||||
if (myRenderParams.Method == Graphic3d_RM_RAYTRACING
|
||||
if (myRenderParams->Method == Graphic3d_RM_RAYTRACING
|
||||
&& !myCaps->vboDisable
|
||||
&& !myCaps->keepArrayData)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ void OpenGl_View::Redraw()
|
||||
myWindow->SetSwapInterval();
|
||||
|
||||
++myFrameCounter;
|
||||
const Graphic3d_StereoMode aStereoMode = myRenderParams.StereoMode;
|
||||
const Graphic3d_StereoMode aStereoMode = myRenderParams->StereoMode;
|
||||
Graphic3d_Camera::Projection aProjectType = myCamera->ProjectionType();
|
||||
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
|
||||
|
||||
@@ -501,7 +501,7 @@ void OpenGl_View::RedrawImmediate()
|
||||
return;
|
||||
}
|
||||
|
||||
const Graphic3d_StereoMode aStereoMode = myRenderParams.StereoMode;
|
||||
const Graphic3d_StereoMode aStereoMode = myRenderParams->StereoMode;
|
||||
Graphic3d_Camera::Projection aProjectType = myCamera->ProjectionType();
|
||||
OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )myFBO;
|
||||
|
||||
@@ -1029,7 +1029,7 @@ void OpenGl_View::renderStructs (OpenGl_FrameBuffer* theReadDrawFbo,
|
||||
}
|
||||
|
||||
Standard_Boolean toRenderGL = theToDrawImmediate ||
|
||||
myRenderParams.Method != Graphic3d_RM_RAYTRACING ||
|
||||
myRenderParams->Method != Graphic3d_RM_RAYTRACING ||
|
||||
myRaytraceInitStatus == OpenGl_RT_FAIL ||
|
||||
aCtx->IsFeedback();
|
||||
|
||||
@@ -1290,7 +1290,7 @@ void OpenGl_View::renderScene (OpenGl_FrameBuffer* theReadDrawFbo,
|
||||
|
||||
case Graphic3d_TOD_ENVIRONMENT:
|
||||
myWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
|
||||
if (myRenderParams.Method != Graphic3d_RM_RAYTRACING)
|
||||
if (myRenderParams->Method != Graphic3d_RM_RAYTRACING)
|
||||
{
|
||||
myWorkspace->EnableTexture (myTextureEnv);
|
||||
}
|
||||
@@ -1310,7 +1310,7 @@ void OpenGl_View::renderScene (OpenGl_FrameBuffer* theReadDrawFbo,
|
||||
if (myWorkspace->NamedStatus & OPENGL_NS_2NDPASSNEED)
|
||||
{
|
||||
myWorkspace->NamedStatus |= OPENGL_NS_2NDPASSDO;
|
||||
if (myRenderParams.Method != Graphic3d_RM_RAYTRACING)
|
||||
if (myRenderParams->Method != Graphic3d_RM_RAYTRACING)
|
||||
{
|
||||
myWorkspace->EnableTexture (myTextureEnv);
|
||||
}
|
||||
@@ -1580,18 +1580,18 @@ void OpenGl_View::drawStereoPair()
|
||||
|
||||
myWindow->PlatformWindow()->Position (aGeom.left, aGeom.top, aGeom.right, aGeom.bottom);
|
||||
|
||||
Standard_Boolean toReverse = myRenderParams.ToReverseStereo;
|
||||
Standard_Boolean toReverse = myRenderParams->ToReverseStereo;
|
||||
const Standard_Boolean isOddY = (aGeom.top + aGeom.dy()) % 2 == 1;
|
||||
const Standard_Boolean isOddX = aGeom.left % 2 == 1;
|
||||
if (isOddY
|
||||
&& (myRenderParams.StereoMode == Graphic3d_StereoMode_RowInterlaced
|
||||
|| myRenderParams.StereoMode == Graphic3d_StereoMode_ChessBoard))
|
||||
&& (myRenderParams->StereoMode == Graphic3d_StereoMode_RowInterlaced
|
||||
|| myRenderParams->StereoMode == Graphic3d_StereoMode_ChessBoard))
|
||||
{
|
||||
toReverse = !toReverse;
|
||||
}
|
||||
if (isOddX
|
||||
&& (myRenderParams.StereoMode == Graphic3d_StereoMode_ColumnInterlaced
|
||||
|| myRenderParams.StereoMode == Graphic3d_StereoMode_ChessBoard))
|
||||
&& (myRenderParams->StereoMode == Graphic3d_StereoMode_ColumnInterlaced
|
||||
|| myRenderParams->StereoMode == Graphic3d_StereoMode_ChessBoard))
|
||||
{
|
||||
toReverse = !toReverse;
|
||||
}
|
||||
@@ -1611,14 +1611,14 @@ void OpenGl_View::drawStereoPair()
|
||||
|
||||
const Handle(OpenGl_ShaderManager)& aManager = aCtx->ShaderManager();
|
||||
if (aVerts->IsValid()
|
||||
&& aManager->BindStereoProgram (myRenderParams.StereoMode))
|
||||
&& aManager->BindStereoProgram (myRenderParams->StereoMode))
|
||||
{
|
||||
if (myRenderParams.StereoMode == Graphic3d_StereoMode_Anaglyph)
|
||||
if (myRenderParams->StereoMode == Graphic3d_StereoMode_Anaglyph)
|
||||
{
|
||||
OpenGl_Mat4 aFilterL, aFilterR;
|
||||
aFilterL.SetDiagonal (Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 0.0f));
|
||||
aFilterR.SetDiagonal (Graphic3d_Vec4 (0.0f, 0.0f, 0.0f, 0.0f));
|
||||
switch (myRenderParams.AnaglyphFilter)
|
||||
switch (myRenderParams->AnaglyphFilter)
|
||||
{
|
||||
case Graphic3d_RenderingParams::Anaglyph_RedCyan_Simple:
|
||||
{
|
||||
@@ -1667,8 +1667,8 @@ void OpenGl_View::drawStereoPair()
|
||||
}
|
||||
case Graphic3d_RenderingParams::Anaglyph_UserDefined:
|
||||
{
|
||||
aFilterL = myRenderParams.AnaglyphLeft;
|
||||
aFilterR = myRenderParams.AnaglyphRight;
|
||||
aFilterL = myRenderParams->AnaglyphLeft;
|
||||
aFilterR = myRenderParams->AnaglyphRight;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -53,7 +53,6 @@ namespace
|
||||
static const OpenGl_AspectLine myDefaultAspectLine;
|
||||
static const OpenGl_AspectFace myDefaultAspectFace;
|
||||
static const OpenGl_AspectMarker myDefaultAspectMarker;
|
||||
static const OpenGl_AspectText myDefaultAspectText;
|
||||
|
||||
static const OpenGl_TextParam myDefaultTextParam =
|
||||
{
|
||||
@@ -156,10 +155,6 @@ OpenGl_Workspace::OpenGl_Workspace (OpenGl_View* theView, const Handle(OpenGl_Wi
|
||||
AspectFace_applied (NULL),
|
||||
AspectMarker_set (&myDefaultAspectMarker),
|
||||
AspectMarker_applied (NULL),
|
||||
AspectText_set (&myDefaultAspectText),
|
||||
AspectText_applied (NULL),
|
||||
TextParam_set (&myDefaultTextParam),
|
||||
TextParam_applied (NULL),
|
||||
ViewMatrix_applied (&myDefaultMatrix),
|
||||
StructureMatrix_applied (&myDefaultMatrix),
|
||||
myCullingMode (TelCullUndefined),
|
||||
@@ -252,10 +247,6 @@ void OpenGl_Workspace::ResetAppliedAspect()
|
||||
AspectFace_applied = NULL;
|
||||
AspectMarker_set = &myDefaultAspectMarker;
|
||||
AspectMarker_applied = NULL;
|
||||
AspectText_set = &myDefaultAspectText;
|
||||
AspectText_applied = NULL;
|
||||
TextParam_set = &myDefaultTextParam;
|
||||
TextParam_applied = NULL;
|
||||
PolygonOffset_applied = THE_DEFAULT_POFFSET;
|
||||
myCullingMode = TelCullUndefined;
|
||||
|
||||
@@ -1063,7 +1054,6 @@ const OpenGl_AspectText* OpenGl_Workspace::AspectText (const Standard_Boolean th
|
||||
if (theWithApply)
|
||||
{
|
||||
AspectText_applied = AspectText_set;
|
||||
TextParam_applied = TextParam_set;
|
||||
}
|
||||
|
||||
return AspectText_set;
|
||||
|
@@ -177,17 +177,11 @@ public:
|
||||
Standard_EXPORT const OpenGl_AspectMarker* SetAspectMarker (const OpenGl_AspectMarker* theAspect);
|
||||
Standard_EXPORT const OpenGl_AspectText* SetAspectText (const OpenGl_AspectText* theAspect);
|
||||
|
||||
void SetTextParam (const OpenGl_TextParam* theParam) { TextParam_set = theParam; }
|
||||
|
||||
//// THESE METHODS ARE EXPORTED AS THEY PROVIDE STATE INFO TO USERDRAW
|
||||
Standard_EXPORT const OpenGl_AspectLine* AspectLine (const Standard_Boolean theWithApply);
|
||||
Standard_EXPORT const OpenGl_AspectFace* AspectFace (const Standard_Boolean theWithApply);
|
||||
Standard_EXPORT const OpenGl_AspectMarker* AspectMarker (const Standard_Boolean theWithApply);
|
||||
Standard_EXPORT const OpenGl_AspectText* AspectText (const Standard_Boolean theWithApply);
|
||||
inline const OpenGl_TextParam* AspectTextParams() const
|
||||
{
|
||||
return TextParam_applied;
|
||||
}
|
||||
|
||||
//! Clear the applied aspect state.
|
||||
void ResetAppliedAspect();
|
||||
@@ -274,8 +268,6 @@ protected: //! @name fields related to status
|
||||
const OpenGl_AspectMarker *AspectMarker_set, *AspectMarker_applied;
|
||||
const OpenGl_AspectText *AspectText_set, *AspectText_applied;
|
||||
|
||||
const OpenGl_TextParam *TextParam_set, *TextParam_applied;
|
||||
|
||||
const OpenGl_Matrix* ViewMatrix_applied;
|
||||
const OpenGl_Matrix* StructureMatrix_applied;
|
||||
|
||||
|
@@ -17,19 +17,17 @@
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Prs3d_DatumAspect::Prs3d_DatumAspect () {
|
||||
|
||||
myFirstAxisAspect = new Prs3d_LineAspect
|
||||
(Quantity_NOC_PEACHPUFF,Aspect_TOL_SOLID,1.);
|
||||
mySecondAxisAspect = new Prs3d_LineAspect
|
||||
(Quantity_NOC_PEACHPUFF,Aspect_TOL_SOLID,1.);
|
||||
myThirdAxisAspect = new Prs3d_LineAspect
|
||||
(Quantity_NOC_PEACHPUFF,Aspect_TOL_SOLID,1.);
|
||||
myDrawFirstAndSecondAxis = Standard_True;
|
||||
myDrawThirdAxis = Standard_True;
|
||||
myFirstAxisLength = 10.;
|
||||
mySecondAxisLength = 10.;
|
||||
myThirdAxisLength = 10.;
|
||||
Prs3d_DatumAspect::Prs3d_DatumAspect()
|
||||
: myDrawFirstAndSecondAxis (Standard_True),
|
||||
myDrawThirdAxis (Standard_True),
|
||||
myToDrawLabels (Standard_True),
|
||||
myFirstAxisLength (10.0),
|
||||
mySecondAxisLength (10.0),
|
||||
myThirdAxisLength (10.0)
|
||||
{
|
||||
myFirstAxisAspect = new Prs3d_LineAspect (Quantity_NOC_PEACHPUFF,Aspect_TOL_SOLID, 1.0);
|
||||
mySecondAxisAspect = new Prs3d_LineAspect (Quantity_NOC_PEACHPUFF,Aspect_TOL_SOLID, 1.0);
|
||||
myThirdAxisAspect = new Prs3d_LineAspect (Quantity_NOC_PEACHPUFF,Aspect_TOL_SOLID, 1.0);
|
||||
}
|
||||
|
||||
Handle(Prs3d_LineAspect) Prs3d_DatumAspect::FirstAxisAspect() const {
|
||||
@@ -96,3 +94,21 @@ Quantity_Length Prs3d_DatumAspect::ThirdAxisLength () const {
|
||||
return myThirdAxisLength;
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetToDrawLabels
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Prs3d_DatumAspect::SetToDrawLabels (const Standard_Boolean theToDraw)
|
||||
{
|
||||
myToDrawLabels = theToDraw;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ToDrawLabels
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean Prs3d_DatumAspect::ToDrawLabels() const
|
||||
{
|
||||
return myToDrawLabels;
|
||||
}
|
||||
|
@@ -36,7 +36,6 @@ class Prs3d_DatumAspect : public Prs3d_BasicAspect
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! An empty framework to define the display of datums.
|
||||
Standard_EXPORT Prs3d_DatumAspect();
|
||||
|
||||
@@ -73,29 +72,26 @@ public:
|
||||
//! Returns the length of the displayed third axis.
|
||||
Standard_EXPORT Quantity_Length ThirdAxisLength() const;
|
||||
|
||||
//! Sets option to draw or not to draw text labels for axes
|
||||
Standard_EXPORT void SetToDrawLabels (const Standard_Boolean theToDraw);
|
||||
|
||||
|
||||
//! @return true if axes labels are drawn
|
||||
Standard_EXPORT Standard_Boolean ToDrawLabels() const;
|
||||
|
||||
DEFINE_STANDARD_RTTI(Prs3d_DatumAspect,Prs3d_BasicAspect)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Prs3d_LineAspect) myFirstAxisAspect;
|
||||
Handle(Prs3d_LineAspect) mySecondAxisAspect;
|
||||
Handle(Prs3d_LineAspect) myThirdAxisAspect;
|
||||
Standard_Boolean myDrawFirstAndSecondAxis;
|
||||
Standard_Boolean myDrawThirdAxis;
|
||||
Standard_Boolean myToDrawLabels;
|
||||
Quantity_Length myFirstAxisLength;
|
||||
Quantity_Length mySecondAxisLength;
|
||||
Quantity_Length myThirdAxisLength;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -385,6 +385,7 @@
|
||||
#include <RWStepRepr_RWReprItemAndLengthMeasureWithUnit.hxx>
|
||||
#include <RWStepRepr_RWShapeAspect.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectRelationship.hxx>
|
||||
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectTransition.hxx>
|
||||
#include <RWStepRepr_RWShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
#include <RWStepRepr_RWSpecifiedHigherUsageOccurrence.hxx>
|
||||
@@ -923,6 +924,7 @@
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectDerivingRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectTransition.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
@@ -1266,6 +1268,11 @@
|
||||
#include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <RWStepRepr_RWIntegerRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
|
||||
#include <RWStepVisual_RWAnnotationCurveOccurrence.hxx>
|
||||
#include <RWStepVisual_RWAnnotationOccurrence.hxx>
|
||||
#include <RWStepVisual_RWAnnotationPlane.hxx>
|
||||
#include <RWStepVisual_RWDraughtingCallout.hxx>
|
||||
|
||||
#include <StepRepr_Apex.hxx>
|
||||
#include <StepRepr_CentreOfSymmetry.hxx>
|
||||
@@ -1309,6 +1316,10 @@
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
#include <StepVisual_AnnotationPlane.hxx>
|
||||
#include <StepVisual_DraughtingCallout.hxx>
|
||||
|
||||
static Standard_Integer catsh,catdr,catstr,catdsc,cataux;
|
||||
|
||||
@@ -1385,10 +1396,17 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
DeclareAndCast(StepVisual_AnnotationCurveOccurrence,anent,ent);
|
||||
RWStepVisual_RWAnnotationCurveOccurrence tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
DeclareAndCast(StepVisual_StyledItem,anent,ent);
|
||||
RWStepVisual_RWStyledItem tool;
|
||||
DeclareAndCast(StepVisual_AnnotationOccurrence,anent,ent);
|
||||
RWStepVisual_RWAnnotationOccurrence tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
@@ -1857,6 +1875,13 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 107:
|
||||
{
|
||||
DeclareAndCast(StepVisual_DraughtingCallout,anent,ent);
|
||||
RWStepVisual_RWDraughtingCallout tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 116:
|
||||
{
|
||||
DeclareAndCast(StepShape_EdgeCurve,anent,ent);
|
||||
@@ -4970,6 +4995,27 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 702:
|
||||
{
|
||||
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 703:
|
||||
{
|
||||
DeclareAndCast(StepAP242_DraughtingModelItemAssociation,anent,ent);
|
||||
RWStepAP242_RWDraughtingModelItemAssociation tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 704:
|
||||
{
|
||||
DeclareAndCast(StepVisual_AnnotationPlane,anent,ent);
|
||||
RWStepVisual_RWAnnotationPlane tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
|
||||
default : break;
|
||||
}
|
||||
@@ -5124,6 +5170,9 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
case 3 :
|
||||
ent = new StepShape_AdvancedFace;
|
||||
break;
|
||||
case 4 :
|
||||
ent = new StepVisual_AnnotationCurveOccurrence;
|
||||
break;
|
||||
case 7 :
|
||||
ent = new StepVisual_AnnotationOccurrence;
|
||||
break;
|
||||
@@ -5385,6 +5434,9 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
case 106 :
|
||||
ent = new StepVisual_AnnotationOccurrence;
|
||||
break;
|
||||
case 107 :
|
||||
ent = new StepVisual_DraughtingCallout;
|
||||
break;
|
||||
case 108 :
|
||||
ent = new StepVisual_DraughtingPreDefinedColour;
|
||||
break;
|
||||
@@ -6917,6 +6969,15 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
case 701:
|
||||
ent = new StepRepr_ValueRepresentationItem;
|
||||
break;
|
||||
case 702:
|
||||
ent = new StepRepr_FeatureForDatumTargetRelationship;
|
||||
break;
|
||||
case 703:
|
||||
ent = new StepAP242_DraughtingModelItemAssociation;
|
||||
break;
|
||||
case 704:
|
||||
ent = new StepVisual_AnnotationPlane;
|
||||
break;
|
||||
|
||||
default:
|
||||
return Standard_False;
|
||||
@@ -7497,7 +7558,10 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber
|
||||
case 698:
|
||||
case 699:
|
||||
case 700:
|
||||
case 701: return catdr;
|
||||
case 701:
|
||||
case 702:
|
||||
case 703:
|
||||
case 704: return catdr;
|
||||
|
||||
default : break;
|
||||
}
|
||||
|
@@ -295,6 +295,7 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <StepBasic_SecurityClassificationLevel.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectTransition.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
@@ -686,6 +687,7 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <RWStepBasic_RWSecurityClassificationLevel.hxx>
|
||||
#include <RWStepRepr_RWShapeAspect.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectRelationship.hxx>
|
||||
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectTransition.hxx>
|
||||
#include <RWStepShape_RWShapeDefinitionRepresentation.hxx>
|
||||
#include <RWStepShape_RWShapeRepresentation.hxx>
|
||||
@@ -1314,6 +1316,13 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <RWStepRepr_RWIntegerRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
|
||||
#include <RWStepVisual_RWAnnotationCurveOccurrence.hxx>
|
||||
#include <RWStepVisual_RWAnnotationOccurrence.hxx>
|
||||
#include <RWStepVisual_RWAnnotationPlane.hxx>
|
||||
#include <RWStepVisual_RWDraughtingCallout.hxx>
|
||||
|
||||
|
||||
#include <StepRepr_Apex.hxx>
|
||||
#include <StepRepr_CentreOfSymmetry.hxx>
|
||||
@@ -1357,6 +1366,11 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
#include <StepVisual_AnnotationPlane.hxx>
|
||||
#include <StepVisual_DraughtingCallout.hxx>
|
||||
|
||||
|
||||
|
||||
// -- General Declarations (Recognize, StepType) ---
|
||||
@@ -1985,6 +1999,9 @@ static TCollection_AsciiString Reco_DatumSystem("DATUM_SYSTEM");
|
||||
static TCollection_AsciiString Reco_GeneralDatumReference("GENERAL_DATUM_REFERENCE");
|
||||
static TCollection_AsciiString Reco_IntegerRepresentationItem("INTEGER_REPRESENTATION_ITEM");
|
||||
static TCollection_AsciiString Reco_ValueRepresentationItem("VALUE_REPRESENTATION_ITEM");
|
||||
static TCollection_AsciiString Reco_FeatureForDatumTargetRelationship("FEARURE_FOR_DATUM_TARGET_RELATIONSHIP");
|
||||
static TCollection_AsciiString Reco_DraughtingModelItemAssociation("DRAUGHTING_MODEL_ITEM_ASSOCIATION");
|
||||
static TCollection_AsciiString Reco_AnnotationPlane("ANNOTATION_PLANE");
|
||||
|
||||
// -- Definition of the libraries --
|
||||
|
||||
@@ -2628,6 +2645,9 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
|
||||
typenums->SetItem (Reco_GeneralDatumReference, 690);
|
||||
typenums->SetItem (Reco_IntegerRepresentationItem, 700);
|
||||
typenums->SetItem (Reco_ValueRepresentationItem, 701);
|
||||
typenums->SetItem (Reco_FeatureForDatumTargetRelationship, 702);
|
||||
typenums->SetItem (Reco_DraughtingModelItemAssociation, 703);
|
||||
typenums->SetItem (Reco_AnnotationPlane, 704);
|
||||
|
||||
// SHORT NAMES
|
||||
// NB : la liste est celle de AP203
|
||||
@@ -2933,6 +2953,8 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
|
||||
// typeshor->SetItem (ShapeDimensionRepresentation);
|
||||
|
||||
typeshor->SetItem ("MMWU",651);
|
||||
typeshor->SetItem ("DMIA", 703);
|
||||
typeshor->SetItem ("ANNPLN", 704);
|
||||
|
||||
}
|
||||
|
||||
@@ -4148,6 +4170,9 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
|
||||
case 690: return Reco_GeneralDatumReference;
|
||||
case 700: return Reco_IntegerRepresentationItem;
|
||||
case 701: return Reco_ValueRepresentationItem;
|
||||
case 702: return Reco_FeatureForDatumTargetRelationship;
|
||||
case 703: return Reco_DraughtingModelItemAssociation;
|
||||
case 704: return Reco_AnnotationPlane;
|
||||
|
||||
default : return PasReco;
|
||||
}
|
||||
@@ -4488,11 +4513,17 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
{
|
||||
DeclareAndCast(StepVisual_AnnotationCurveOccurrence, anent, ent);
|
||||
RWStepVisual_RWAnnotationCurveOccurrence tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
{
|
||||
DeclareAndCast(StepVisual_StyledItem, anent, ent);
|
||||
RWStepVisual_RWStyledItem tool;
|
||||
DeclareAndCast(StepVisual_AnnotationOccurrence, anent, ent);
|
||||
RWStepVisual_RWAnnotationOccurrence tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
|
||||
@@ -5183,6 +5214,13 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
|
||||
break;
|
||||
case 107 :
|
||||
{
|
||||
DeclareAndCast(StepVisual_DraughtingCallout, anent, ent);
|
||||
RWStepVisual_RWDraughtingCallout tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 108 :
|
||||
{
|
||||
@@ -8867,6 +8905,27 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 702:
|
||||
{
|
||||
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 703:
|
||||
{
|
||||
DeclareAndCast(StepAP242_DraughtingModelItemAssociation,anent,ent);
|
||||
RWStepAP242_RWDraughtingModelItemAssociation tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 704:
|
||||
{
|
||||
DeclareAndCast(StepVisual_AnnotationPlane,anent,ent);
|
||||
RWStepVisual_RWAnnotationPlane tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ach->AddFail("Type Mismatch when reading - Entity");
|
||||
@@ -8912,12 +8971,18 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
|
||||
break;
|
||||
case 4 :
|
||||
{
|
||||
DeclareAndCast(StepVisual_AnnotationCurveOccurrence, anent, ent);
|
||||
RWStepVisual_RWAnnotationCurveOccurrence tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
{
|
||||
DeclareAndCast(StepVisual_StyledItem, anent, ent);
|
||||
RWStepVisual_RWStyledItem tool;
|
||||
// if (anent.IsNull()) return;
|
||||
DeclareAndCast(StepVisual_AnnotationOccurrence, anent, ent);
|
||||
RWStepVisual_RWAnnotationOccurrence tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
|
||||
@@ -9695,6 +9760,13 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
|
||||
break;
|
||||
case 107 :
|
||||
{
|
||||
DeclareAndCast(StepVisual_DraughtingCallout, anent, ent);
|
||||
RWStepVisual_RWDraughtingCallout tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
case 108 :
|
||||
{
|
||||
@@ -13568,6 +13640,27 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
case 702:
|
||||
{
|
||||
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
case 703:
|
||||
{
|
||||
DeclareAndCast(StepAP242_DraughtingModelItemAssociation,anent,ent);
|
||||
RWStepAP242_RWDraughtingModelItemAssociation tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
case 704:
|
||||
{
|
||||
DeclareAndCast(StepVisual_AnnotationPlane,anent,ent);
|
||||
RWStepVisual_RWAnnotationPlane tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
|
@@ -1,3 +1,5 @@
|
||||
RWStepAP242_RWDraughtingModelItemAssociation.cxx
|
||||
RWStepAP242_RWDraughtingModelItemAssociation.hxx
|
||||
RWStepAP242_RWGeometricItemSpecificUsage.cxx
|
||||
RWStepAP242_RWGeometricItemSpecificUsage.hxx
|
||||
RWStepAP242_RWIdAttribute.cxx
|
||||
|
108
src/RWStepAP242/RWStepAP242_RWDraughtingModelItemAssociation.cxx
Normal file
108
src/RWStepAP242/RWStepAP242_RWDraughtingModelItemAssociation.cxx
Normal file
@@ -0,0 +1,108 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <StepRepr_Representation.hxx>
|
||||
|
||||
RWStepAP242_RWDraughtingModelItemAssociation::RWStepAP242_RWDraughtingModelItemAssociation () {}
|
||||
|
||||
void RWStepAP242_RWDraughtingModelItemAssociation::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!data->CheckNbParams(num,5,ach,"geometric_item_specific_usage")) return;
|
||||
|
||||
// Inherited fields of ItemIdentifiedRepresentationUsage
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num,1,"item_identified_representation_usage.name",ach,aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
if (data->IsParamDefined (num,2)) {
|
||||
data->ReadString (num,2,"item_identified_representation_usage.description",ach,aDescription);
|
||||
}
|
||||
|
||||
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
|
||||
data->ReadEntity(num,3,"item_identified_representation_usage.definition",ach,aDefinition);
|
||||
|
||||
Handle(StepRepr_Representation) aRepresentation;
|
||||
data->ReadEntity (num,4,"item_identified_representation_usage.used_representation",ach,STANDARD_TYPE(StepRepr_Representation), aRepresentation);
|
||||
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItems;
|
||||
Handle(StepRepr_RepresentationItem) anEnt;
|
||||
Standard_Integer nbSub;
|
||||
Interface_ParamType aType = data->ParamType(num, 5);
|
||||
if (aType == Interface_ParamIdent) {
|
||||
data->ReadEntity(num, 5,"item_identified_representation_usage.identified_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anEnt);
|
||||
anItems = new StepRepr_HArray1OfRepresentationItem (1, 1);
|
||||
anItems->SetValue(1, anEnt);
|
||||
}
|
||||
else if (data->ReadSubList (num,5,"item_identified_representation_usage.identified_item",ach,nbSub)) {
|
||||
Standard_Integer nbElements = data->NbParams(nbSub);
|
||||
anItems = new StepRepr_HArray1OfRepresentationItem (1, nbElements);
|
||||
for (Standard_Integer i = 1; i <= nbElements; i++) {
|
||||
if (data->ReadEntity(nbSub, i,"representation_item", ach,
|
||||
STANDARD_TYPE(StepRepr_RepresentationItem), anEnt))
|
||||
anItems->SetValue(i, anEnt);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aDescription, aDefinition, aRepresentation, anItems);
|
||||
}
|
||||
|
||||
void RWStepAP242_RWDraughtingModelItemAssociation::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const
|
||||
{
|
||||
// Inherited fields of ItemIdentifiedRepresentationUsage
|
||||
SW.Send(ent->Name());
|
||||
|
||||
SW.Send(ent->Description());
|
||||
|
||||
SW.Send(ent->Definition().Value());
|
||||
|
||||
SW.Send(ent->UsedRepresentation());
|
||||
|
||||
if (ent->NbIdentifiedItem() == 1)
|
||||
SW.Send(ent->IdentifiedItemValue(1));
|
||||
else {
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i = 1; i <= ent->NbIdentifiedItem(); i++) {
|
||||
SW.Send(ent->IdentifiedItemValue(i));
|
||||
}
|
||||
SW.CloseSub();
|
||||
}
|
||||
}
|
||||
|
||||
void RWStepAP242_RWDraughtingModelItemAssociation::Share(
|
||||
const Handle(StepAP242_DraughtingModelItemAssociation)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
// Inherited fields of ItemIdentifiedRepresentationUsage
|
||||
|
||||
iter.AddItem(ent->Definition().Value());
|
||||
Standard_Integer i, nb = ent->NbIdentifiedItem();
|
||||
for (i = 1; i <= nb; i++)
|
||||
iter.AddItem (ent->IdentifiedItemValue(i));
|
||||
}
|
||||
|
@@ -0,0 +1,46 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepAP242_RWDraughtingModelItemAssociation_HeaderFile
|
||||
#define _RWStepAP242_RWDraughtingModelItemAssociation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepAP242_DraughtingModelItemAssociation;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
//! Read & Write Module for DraughtingModelItemAssociation
|
||||
class RWStepAP242_RWDraughtingModelItemAssociation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepAP242_RWDraughtingModelItemAssociation();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepAP242_DraughtingModelItemAssociation)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepAP242_DraughtingModelItemAssociation)& ent, Interface_EntityIterator& iter) const;
|
||||
};
|
||||
#endif // _RWStepAP242_RWDraughtingModelItemAssociation_HeaderFile
|
@@ -38,6 +38,8 @@ RWStepRepr_RWDescriptiveRepresentationItem.cxx
|
||||
RWStepRepr_RWDescriptiveRepresentationItem.hxx
|
||||
RWStepRepr_RWExtension.cxx
|
||||
RWStepRepr_RWExtension.hxx
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship.cxx
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship.hxx
|
||||
RWStepRepr_RWFunctionallyDefinedTransformation.cxx
|
||||
RWStepRepr_RWFunctionallyDefinedTransformation.hxx
|
||||
RWStepRepr_RWGeometricAlignment.cxx
|
||||
|
@@ -0,0 +1,112 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepRepr_RWFeatureForDatumTargetRelationship
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship::RWStepRepr_RWFeatureForDatumTargetRelationship ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepRepr_RWFeatureForDatumTargetRelationship::ReadStep (const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if ( ! data->CheckNbParams(num,4,ach,"feature_for_datum_target-relationship") ) return;
|
||||
|
||||
// Own fields of ShapeAspectRelationship
|
||||
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name", ach, aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
Standard_Boolean hasDescription = Standard_True;
|
||||
if ( data->IsParamDefined (num,2) ) {
|
||||
data->ReadString (num, 2, "description", ach, aDescription);
|
||||
}
|
||||
else {
|
||||
hasDescription = Standard_False;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ShapeAspect) aRelatingShapeAspect;
|
||||
data->ReadEntity (num, 3, "relating_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aRelatingShapeAspect);
|
||||
|
||||
Handle(StepRepr_ShapeAspect) aRelatedShapeAspect;
|
||||
data->ReadEntity (num, 4, "related_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aRelatedShapeAspect);
|
||||
|
||||
// Initialize entity
|
||||
ent->Init(aName,
|
||||
hasDescription,
|
||||
aDescription,
|
||||
aRelatingShapeAspect,
|
||||
aRelatedShapeAspect);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepRepr_RWFeatureForDatumTargetRelationship::WriteStep (StepData_StepWriter& SW,
|
||||
const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent) const
|
||||
{
|
||||
|
||||
// Own fields of ShapeAspectRelationship
|
||||
|
||||
SW.Send (ent->Name());
|
||||
|
||||
if ( ent->HasDescription() ) {
|
||||
SW.Send (ent->Description());
|
||||
}
|
||||
else SW.SendUndef();
|
||||
|
||||
SW.Send (ent->RelatingShapeAspect());
|
||||
|
||||
SW.Send (ent->RelatedShapeAspect());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepRepr_RWFeatureForDatumTargetRelationship::Share (const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
|
||||
// Own fields of ShapeAspectRelationship
|
||||
|
||||
iter.AddItem (ent->RelatingShapeAspect());
|
||||
|
||||
iter.AddItem (ent->RelatedShapeAspect());
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
|
||||
#define _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_FeatureForDatumTargetRelationship;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Read & Write tool for FeatureForDatumTargetRelationship
|
||||
class RWStepRepr_RWFeatureForDatumTargetRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT RWStepRepr_RWFeatureForDatumTargetRelationship();
|
||||
|
||||
//! Reads ShapeAspectRelationship
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent) const;
|
||||
|
||||
//! Writes ShapeAspectRelationship
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent) const;
|
||||
|
||||
//! Fills data for graph (shared items)
|
||||
Standard_EXPORT void Share (const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
|
@@ -1,3 +1,9 @@
|
||||
RWStepVisual_RWAnnotationCurveOccurrence.cxx
|
||||
RWStepVisual_RWAnnotationCurveOccurrence.hxx
|
||||
RWStepVisual_RWAnnotationOccurrence.cxx
|
||||
RWStepVisual_RWAnnotationOccurrence.hxx
|
||||
RWStepVisual_RWAnnotationPlane.cxx
|
||||
RWStepVisual_RWAnnotationPlane.hxx
|
||||
RWStepVisual_RWAreaInSet.cxx
|
||||
RWStepVisual_RWAreaInSet.hxx
|
||||
RWStepVisual_RWBackgroundColour.cxx
|
||||
@@ -32,6 +38,8 @@ RWStepVisual_RWCurveStyleFont.cxx
|
||||
RWStepVisual_RWCurveStyleFont.hxx
|
||||
RWStepVisual_RWCurveStyleFontPattern.cxx
|
||||
RWStepVisual_RWCurveStyleFontPattern.hxx
|
||||
RWStepVisual_RWDraughtingCallout.cxx
|
||||
RWStepVisual_RWDraughtingCallout.hxx
|
||||
RWStepVisual_RWDraughtingModel.cxx
|
||||
RWStepVisual_RWDraughtingModel.hxx
|
||||
RWStepVisual_RWDraughtingPreDefinedColour.cxx
|
||||
|
@@ -0,0 +1,92 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepVisual_RWAnnotationCurveOccurrence.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_RepresentationItem.hxx>
|
||||
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
|
||||
#include <StepVisual_PresentationStyleAssignment.hxx>
|
||||
#include <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
|
||||
RWStepVisual_RWAnnotationCurveOccurrence::RWStepVisual_RWAnnotationCurveOccurrence () {}
|
||||
|
||||
void RWStepVisual_RWAnnotationCurveOccurrence::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const
|
||||
{
|
||||
|
||||
// Number of Parameter Control
|
||||
if (!data->CheckNbParams(num, 3, ach, "styled_item")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name", ach, aName);
|
||||
|
||||
// Inherited field : styles
|
||||
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
|
||||
Handle(StepVisual_PresentationStyleAssignment) anent2;
|
||||
Standard_Integer nsub2;
|
||||
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
|
||||
Standard_Integer nb2 = data->NbParams(nsub2);
|
||||
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
|
||||
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
|
||||
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
|
||||
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
|
||||
aStyles->SetValue(i2, anent2);
|
||||
}
|
||||
}
|
||||
|
||||
// Inherited field : item
|
||||
Handle(StepRepr_RepresentationItem) aItem;
|
||||
data->ReadEntity(num, 3,"item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aStyles, aItem);
|
||||
}
|
||||
|
||||
void RWStepVisual_RWAnnotationCurveOccurrence::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const
|
||||
{
|
||||
//Inherited field : name
|
||||
SW.Send(ent->Name());
|
||||
|
||||
// Inherited field : styles
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
|
||||
SW.Send(ent->StylesValue(i2));
|
||||
}
|
||||
SW.CloseSub();
|
||||
|
||||
// Inherited field : item
|
||||
|
||||
SW.Send(ent->Item());
|
||||
}
|
||||
|
||||
void RWStepVisual_RWAnnotationCurveOccurrence::Share(const Handle(StepVisual_AnnotationCurveOccurrence)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
|
||||
Standard_Integer nbElem1 = ent->NbStyles();
|
||||
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
|
||||
iter.GetOneItem(ent->StylesValue(is1));
|
||||
}
|
||||
|
||||
iter.GetOneItem(ent->Item());
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepVisual_RWAnnotationCurveOccurrence_HeaderFile
|
||||
#define _RWStepVisual_RWAnnotationCurveOccurrence_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepVisual_AnnotationCurveOccurrence;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
//! Read & Write Module for AnnotationCurveOccurrence
|
||||
class RWStepVisual_RWAnnotationCurveOccurrence
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepVisual_RWAnnotationCurveOccurrence();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationCurveOccurrence)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepVisual_AnnotationCurveOccurrence)& ent, Interface_EntityIterator& iter) const;
|
||||
};
|
||||
#endif // _RWStepVisual_RWAnnotationCurveOccurrence_HeaderFile
|
107
src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.cxx
Normal file
107
src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.cxx
Normal file
@@ -0,0 +1,107 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepVisual_RWAnnotationOccurrence.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_RepresentationItem.hxx>
|
||||
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
|
||||
#include <StepVisual_PresentationStyleAssignment.hxx>
|
||||
#include <StepVisual_AnnotationOccurrence.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepVisual_RWAnnotationOccurrence
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepVisual_RWAnnotationOccurrence::RWStepVisual_RWAnnotationOccurrence () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWAnnotationOccurrence::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepVisual_AnnotationOccurrence)& ent) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!data->CheckNbParams(num, 3, ach, "annotation_occurrence")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name", ach, aName);
|
||||
|
||||
// Inherited field : styles
|
||||
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
|
||||
Handle(StepVisual_PresentationStyleAssignment) anent2;
|
||||
Standard_Integer nsub2;
|
||||
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
|
||||
Standard_Integer nb2 = data->NbParams(nsub2);
|
||||
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
|
||||
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
|
||||
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
|
||||
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
|
||||
aStyles->SetValue(i2, anent2);
|
||||
}
|
||||
}
|
||||
|
||||
// Inherited field : item
|
||||
Handle(StepRepr_RepresentationItem) aItem;
|
||||
data->ReadEntity(num, 3, "item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aStyles, aItem);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWAnnotationOccurrence::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepVisual_AnnotationOccurrence)& ent) const
|
||||
{
|
||||
// Inherited field : name
|
||||
SW.Send(ent->Name());
|
||||
|
||||
// Inherited field : styles
|
||||
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
|
||||
SW.Send(ent->StylesValue(i2));
|
||||
}
|
||||
SW.CloseSub();
|
||||
|
||||
// Inherited field : item
|
||||
|
||||
SW.Send(ent->Item());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWAnnotationOccurrence::Share(const Handle(StepVisual_AnnotationOccurrence)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer nbElem1 = ent->NbStyles();
|
||||
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
|
||||
iter.GetOneItem(ent->StylesValue(is1));
|
||||
}
|
||||
iter.GetOneItem(ent->Item());
|
||||
}
|
45
src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.hxx
Normal file
45
src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.hxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepVisual_RWAnnotationOccurrence_HeaderFile
|
||||
#define _RWStepVisual_RWAnnotationOccurrence_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepVisual_AnnotationOccurrence;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
//! Read & Write Module for AnnotationOccurrence
|
||||
class RWStepVisual_RWAnnotationOccurrence
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepVisual_RWAnnotationOccurrence();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationOccurrence)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationOccurrence)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepVisual_AnnotationOccurrence)& ent, Interface_EntityIterator& iter) const;
|
||||
};
|
||||
#endif // _RWStepVisual_RWAnnotationOccurrence_HeaderFile
|
133
src/RWStepVisual/RWStepVisual_RWAnnotationPlane.cxx
Normal file
133
src/RWStepVisual/RWStepVisual_RWAnnotationPlane.cxx
Normal file
@@ -0,0 +1,133 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepVisual_RWAnnotationPlane.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_RepresentationItem.hxx>
|
||||
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
|
||||
#include <StepVisual_PresentationStyleAssignment.hxx>
|
||||
#include <StepVisual_AnnotationPlane.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepVisual_RWAnnotationPlane::RWStepVisual_RWAnnotationPlane () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWAnnotationPlane::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepVisual_AnnotationPlane)& ent) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!data->CheckNbParams(num, 4, ach, "annotation_plane")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name", ach, aName);
|
||||
|
||||
// Inherited field : styles
|
||||
Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles;
|
||||
Handle(StepVisual_PresentationStyleAssignment) anent2;
|
||||
Standard_Integer nsub2;
|
||||
if (data->ReadSubList (num,2,"styles",ach,nsub2)) {
|
||||
Standard_Integer nb2 = data->NbParams(nsub2);
|
||||
aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2);
|
||||
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
|
||||
if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach,
|
||||
STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2))
|
||||
aStyles->SetValue(i2, anent2);
|
||||
}
|
||||
}
|
||||
|
||||
// Inherited field : item
|
||||
Handle(StepRepr_RepresentationItem) aItem;
|
||||
data->ReadEntity(num, 3, "item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem);
|
||||
|
||||
// Own field: elements
|
||||
Handle(StepVisual_HArray1OfAnnotationPlaneElement) anElements;
|
||||
StepVisual_AnnotationPlaneElement anEnt;
|
||||
Standard_Integer nbSub;
|
||||
if (data->ReadSubList (num, 4, "elements", ach, nbSub)) {
|
||||
Standard_Integer nbElements = data->NbParams(nbSub);
|
||||
anElements = new StepVisual_HArray1OfAnnotationPlaneElement (1, nbElements);
|
||||
for (Standard_Integer i = 1; i <= nbElements; i++) {
|
||||
if (data->ReadEntity(nbSub, i,"content", ach, anEnt))
|
||||
anElements->SetValue(i, anEnt);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aStyles, aItem, anElements);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWAnnotationPlane::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepVisual_AnnotationPlane)& ent) const
|
||||
{
|
||||
// Inherited field : name
|
||||
|
||||
SW.Send(ent->Name());
|
||||
|
||||
// Inherited field : styles
|
||||
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) {
|
||||
SW.Send(ent->StylesValue(i2));
|
||||
}
|
||||
SW.CloseSub();
|
||||
|
||||
// Inherited field : item
|
||||
SW.Send(ent->Item());
|
||||
|
||||
// Own field: elements
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i = 1; i <= ent->NbElements(); i++) {
|
||||
SW.Send(ent->ElementsValue(i).Value());
|
||||
}
|
||||
SW.CloseSub();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWAnnotationPlane::Share(const Handle(StepVisual_AnnotationPlane)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer nbElem1 = ent->NbStyles();
|
||||
for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) {
|
||||
iter.GetOneItem(ent->StylesValue(is1));
|
||||
}
|
||||
iter.GetOneItem(ent->Item());
|
||||
|
||||
// Own field: contents
|
||||
Standard_Integer i, nb = ent->NbElements();
|
||||
for (i = 1; i <= nb; i++)
|
||||
iter.AddItem (ent->ElementsValue(i).Value());
|
||||
}
|
||||
|
45
src/RWStepVisual/RWStepVisual_RWAnnotationPlane.hxx
Normal file
45
src/RWStepVisual/RWStepVisual_RWAnnotationPlane.hxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepVisual_RWAnnotationPlane_HeaderFile
|
||||
#define _RWStepVisual_RWAnnotationPlane_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepVisual_AnnotationPlane;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
//! Read & Write Module for AnnotationPlane
|
||||
class RWStepVisual_RWAnnotationPlane
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepVisual_RWAnnotationPlane();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_AnnotationPlane)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_AnnotationPlane)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepVisual_AnnotationPlane)& ent, Interface_EntityIterator& iter) const;
|
||||
};
|
||||
#endif // _RWStepVisual_RWAnnotationPlane_HeaderFile
|
93
src/RWStepVisual/RWStepVisual_RWDraughtingCallout.cxx
Normal file
93
src/RWStepVisual/RWStepVisual_RWDraughtingCallout.cxx
Normal file
@@ -0,0 +1,93 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepVisual_RWDraughtingCallout.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepVisual_DraughtingCallout.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepVisual_RWDraughtingCallout
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepVisual_RWDraughtingCallout::RWStepVisual_RWDraughtingCallout () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Read
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWDraughtingCallout::ReadStep(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepVisual_DraughtingCallout)& ent) const
|
||||
{
|
||||
if (!data->CheckNbParams(num, 2, ach, "draughting_callout")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name" ,ach, aName);
|
||||
|
||||
// Own field: contents
|
||||
Handle(StepVisual_HArray1OfDraughtingCalloutElement) aContents;
|
||||
StepVisual_DraughtingCalloutElement anEnt;
|
||||
Standard_Integer nbSub;
|
||||
if (data->ReadSubList (num, 2, "contents", ach, nbSub)) {
|
||||
Standard_Integer nbElements = data->NbParams(nbSub);
|
||||
aContents = new StepVisual_HArray1OfDraughtingCalloutElement (1, nbElements);
|
||||
for (Standard_Integer i = 1; i <= nbElements; i++) {
|
||||
if (data->ReadEntity(nbSub, i,"content", ach, anEnt))
|
||||
aContents->SetValue(i, anEnt);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aContents);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Write
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepVisual_RWDraughtingCallout::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepVisual_DraughtingCallout)& ent) const
|
||||
{
|
||||
// Inherited field: name
|
||||
SW.Send(ent->Name());
|
||||
|
||||
// Own field: contents
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i = 1; i <= ent->NbContents(); i++) {
|
||||
SW.Send(ent->ContentsValue(i).Value());
|
||||
}
|
||||
SW.CloseSub();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepVisual_RWDraughtingCallout::Share (const Handle(StepVisual_DraughtingCallout) &ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
// Own field: contents
|
||||
Standard_Integer i, nb = ent->NbContents();
|
||||
for (i = 1; i <= nb; i++)
|
||||
iter.AddItem (ent->ContentsValue(i).Value());
|
||||
}
|
||||
|
45
src/RWStepVisual/RWStepVisual_RWDraughtingCallout.hxx
Normal file
45
src/RWStepVisual/RWStepVisual_RWDraughtingCallout.hxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepVisual_RWDraughtingCallout_HeaderFile
|
||||
#define _RWStepVisual_RWDraughtingCallout_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class Interface_EntityIterator;
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepVisual_DraughtingCallout;
|
||||
class StepData_StepWriter;
|
||||
|
||||
//! Read & Write Module for DraughtingCallout
|
||||
class RWStepVisual_RWDraughtingCallout
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepVisual_RWDraughtingCallout();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_DraughtingCallout)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_DraughtingCallout)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepVisual_DraughtingCallout)& ent, Interface_EntityIterator& iter) const;
|
||||
};
|
||||
#endif // _RWStepVisual_RWDraughtingCallout_HeaderFile
|
File diff suppressed because it is too large
Load Diff
@@ -2079,7 +2079,8 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
|
||||
for(i=1; i<=DGTLabels.Length(); i++) {
|
||||
TDF_Label DatumL = DGTLabels.Value(i);
|
||||
TDF_LabelSequence ShapeL;
|
||||
if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL)) continue;
|
||||
TDF_LabelSequence aNullSeq;
|
||||
if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL,aNullSeq)) continue;
|
||||
// find target shape
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
|
||||
TopLoc_Location Loc;
|
||||
@@ -2160,7 +2161,8 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
|
||||
for(i=1; i<=DGTLabels.Length(); i++) {
|
||||
TDF_Label DimTolL = DGTLabels.Value(i);
|
||||
TDF_LabelSequence ShapeL;
|
||||
if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL)) continue;
|
||||
TDF_LabelSequence aNullSeq;
|
||||
if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL,aNullSeq)) continue;
|
||||
// find target shape
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
|
||||
TopLoc_Location Loc;
|
||||
|
@@ -12,6 +12,8 @@ STEPConstruct_DataMapOfAsciiStringTransient.hxx
|
||||
STEPConstruct_DataMapOfPointTransient.hxx
|
||||
STEPConstruct_ExternRefs.cxx
|
||||
STEPConstruct_ExternRefs.hxx
|
||||
STEPConstruct_GDTProperty.cxx
|
||||
STEPConstruct_GDTProperty.hxx
|
||||
STEPConstruct_Part.cxx
|
||||
STEPConstruct_Part.hxx
|
||||
STEPConstruct_PointHasher.cxx
|
||||
|
600
src/STEPConstruct/STEPConstruct_GDTProperty.cxx
Normal file
600
src/STEPConstruct/STEPConstruct_GDTProperty.cxx
Normal file
@@ -0,0 +1,600 @@
|
||||
// Created on: 1999-09-09
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 1999-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <STEPConstruct_GDTProperty.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPConstruct_GDTProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPConstruct_GDTProperty::STEPConstruct_GDTProperty ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getDimModifiers
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void STEPConstruct_GDTProperty::GetDimModifiers(const Handle(StepRepr_CompoundRepresentationItem)& theCRI,
|
||||
XCAFDimTolObjects_DimensionModifiersSequence& theModifiers)
|
||||
{
|
||||
for (Standard_Integer l = 1; l <= theCRI->ItemElement()->Length(); l++)
|
||||
{
|
||||
Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
|
||||
Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(theCRI->ItemElement()->Value(l));
|
||||
if(aDRI.IsNull()) continue;
|
||||
XCAFDimTolObjects_DimensionModif aModifier = XCAFDimTolObjects_DimensionModif_ControlledRadius;
|
||||
const TCollection_AsciiString aModifStr = aDRI->Description()->String();
|
||||
Standard_Boolean aFound = Standard_False;
|
||||
if(aModifStr.IsEqual("controlled radius"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_ControlledRadius;
|
||||
}
|
||||
else if(aModifStr.IsEqual("square"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_Square;
|
||||
}
|
||||
else if(aModifStr.IsEqual("statistical"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_StatisticalTolerance;
|
||||
}
|
||||
else if(aModifStr.IsEqual("continuous feature"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_ContinuousFeature;
|
||||
}
|
||||
else if(aModifStr.IsEqual("two point size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_TwoPointSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("local size defined by a sphere"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_LocalSizeDefinedBySphere;
|
||||
}
|
||||
else if(aModifStr.IsEqual("least squares association criteria"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_LeastSquaresAssociationCriterion;
|
||||
}
|
||||
else if(aModifStr.IsEqual("maximum inscribed association criteria"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MaximumInscribedAssociation;
|
||||
}
|
||||
else if(aModifStr.IsEqual("minimum circumscribed association criteria"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MinimumCircumscribedAssociation;
|
||||
}
|
||||
else if(aModifStr.IsEqual("circumference diameter calculated size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_CircumferenceDiameter;
|
||||
}
|
||||
else if(aModifStr.IsEqual("area diameter calculated size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AreaDiameter;
|
||||
}
|
||||
else if(aModifStr.IsEqual("volume diameter calculated size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_VolumeDiameter;
|
||||
}
|
||||
else if(aModifStr.IsEqual("maximum rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MaximumSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("minimum rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MinimumSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("average rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AverageSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("median rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MedianSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("mid range rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MidRangeSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("range rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_RangeOfSizes;
|
||||
}
|
||||
else if(aModifStr.IsEqual("any part of the feature"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AnyRestrictedPortionOfFeature;
|
||||
}
|
||||
else if(aModifStr.IsEqual("any cross section"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AnyCrossSection;
|
||||
}
|
||||
else if(aModifStr.IsEqual("specific fixed cross section"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_SpecificFixedCrossSection;
|
||||
}
|
||||
else if(aModifStr.IsEqual("common tolerance"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_CommonTolerance;
|
||||
}
|
||||
else if(aModifStr.IsEqual("free state condition"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_FreeStateCondition;
|
||||
}
|
||||
if (aFound)
|
||||
theModifiers.Append(aModifier);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getClassOfTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void STEPConstruct_GDTProperty::GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
|
||||
Standard_Boolean theHolle,
|
||||
XCAFDimTolObjects_DimensionFormVariance theFV,
|
||||
XCAFDimTolObjects_DimensionGrade theG)
|
||||
{
|
||||
Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance();
|
||||
Handle(TCollection_HAsciiString) aGrade = theLAF->Grade();
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_None;
|
||||
Standard_Boolean aFound;
|
||||
theHolle = Standard_False;
|
||||
//it is not verified information
|
||||
for(Standard_Integer c = 0; c <= 1; c++)
|
||||
{
|
||||
aFound = Standard_False;
|
||||
Standard_Boolean aCaseSens = Standard_False;
|
||||
if (c == 1)
|
||||
aCaseSens = Standard_True;
|
||||
Handle(TCollection_HAsciiString) aStr = new TCollection_HAsciiString("a");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_A;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("b");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_B;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("c");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_C;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("cd");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_CD;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("d");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_D;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("e");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_E;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("ef");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_EF;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("f");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_F;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("fg");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_FG;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("g");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_G;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("h");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_H;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("js");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_JS;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("k");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_K;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("m");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_M;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("n");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_N;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("p");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_P;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("r");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_R;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("s");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_S;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("t");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_T;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("u");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_U;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("v");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_V;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("x");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_X;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("y");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_Y;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("b");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_B;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("z");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_Z;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("za");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_ZA;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("zb");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_ZB;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("zc");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_ZC;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == 1 && !aFound)
|
||||
theHolle = Standard_True;
|
||||
}
|
||||
Handle(TCollection_HAsciiString) aStr = new TCollection_HAsciiString("01");
|
||||
if(aGrade->IsSameString(aStr))
|
||||
{
|
||||
theG = XCAFDimTolObjects_DimensionGrade_IT01;
|
||||
}
|
||||
else
|
||||
{
|
||||
theG = (XCAFDimTolObjects_DimensionGrade)(aGrade->IntegerValue()+1);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getDimType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetDimType(const Handle(TCollection_HAsciiString)& theName,
|
||||
XCAFDimTolObjects_DimensionType& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theName->String();
|
||||
aName.LowerCase();
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_None;
|
||||
if(aName.IsEqual("curve length"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_CurveLength;
|
||||
}
|
||||
else if(aName.IsEqual("diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_Diameter;
|
||||
}
|
||||
else if(aName.IsEqual("spherical diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_SphericalDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_Radius;
|
||||
}
|
||||
else if(aName.IsEqual("spherical radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_SphericalRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal minor diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal major diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal minor radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal major radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal high major diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal low major diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal high major radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal low major radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("thickness"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_Thickness;
|
||||
}
|
||||
else if(aName.IsEqual("curved distance"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_CurvedDistance;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance centre outer"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance centre inner"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance outer centre"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance outer outer"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance outer inner"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance inner centre"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance inner outer"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance inner inner"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner;
|
||||
}
|
||||
|
||||
if(theType != XCAFDimTolObjects_DimensionType_Location_None)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DatumTargetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetDatumTargetType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DatumTargetType& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theDescription->String();
|
||||
aName.LowerCase();
|
||||
if(aName.IsEqual("area"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Area;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("line"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Line;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("circle"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Circle;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("rectangle"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Rectangle;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("point"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Point;
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDimQualifierType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetDimQualifierType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DimensionQualifier& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theDescription->String();
|
||||
aName.LowerCase();
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_None;
|
||||
if(aName.IsEqual("maximum"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_Max;
|
||||
}
|
||||
else if(aName.IsEqual("minimum"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_Min;
|
||||
}
|
||||
else if(aName.IsEqual("average"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_Avg;
|
||||
}
|
||||
if(theType != XCAFDimTolObjects_DimensionQualifier_None)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTolValueType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetTolValueType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_GeomToleranceTypeValue& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theDescription->String();
|
||||
aName.LowerCase();
|
||||
theType = XCAFDimTolObjects_GeomToleranceTypeValue_None;
|
||||
if(aName.IsEqual("cylindrical or circular"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_GeomToleranceTypeValue_Diameter;
|
||||
}
|
||||
else if(aName.IsEqual("spherical"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_GeomToleranceTypeValue_SphericalDiameter;
|
||||
}
|
||||
if(theType != XCAFDimTolObjects_GeomToleranceTypeValue_None)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
68
src/STEPConstruct/STEPConstruct_GDTProperty.hxx
Normal file
68
src/STEPConstruct/STEPConstruct_GDTProperty.hxx
Normal file
@@ -0,0 +1,68 @@
|
||||
// Created on: 1999-09-08
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _STEPConstruct_GDTProperty_HeaderFile
|
||||
#define _STEPConstruct_GDTProperty_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <STEPConstruct_Tool.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <StepRepr_CompoundRepresentationItem.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
|
||||
#include <StepShape_LimitsAndFits.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionFormVariance.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionGrade.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionType.hxx>
|
||||
#include <XCAFDimTolObjects_DatumTargetType.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionQualifier.hxx>
|
||||
#include <XCAFDimTolObjects_GeomToleranceTypeValue.hxx>
|
||||
|
||||
//! This class provides tools for access (read)
|
||||
//! the GDT properties.
|
||||
class STEPConstruct_GDTProperty
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT STEPConstruct_GDTProperty();
|
||||
Standard_EXPORT static void GetDimModifiers(const Handle(StepRepr_CompoundRepresentationItem)& theCRI,
|
||||
XCAFDimTolObjects_DimensionModifiersSequence& theModifiers);
|
||||
|
||||
Standard_EXPORT static void GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
|
||||
Standard_Boolean theHolle,
|
||||
XCAFDimTolObjects_DimensionFormVariance theFV,
|
||||
XCAFDimTolObjects_DimensionGrade theG);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetDimType(const Handle(TCollection_HAsciiString)& theName,
|
||||
XCAFDimTolObjects_DimensionType& theType);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetDatumTargetType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DatumTargetType& theType);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetDimQualifierType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DimensionQualifier& theType);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetTolValueType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_GeomToleranceTypeValue& theType);
|
||||
|
||||
};
|
||||
|
||||
#endif // _STEPConstruct_GDTProperty_HeaderFile
|
@@ -71,7 +71,7 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance (const gp_Pnt& theSegP
|
||||
aTc = (Abs (aTn) < Precision::Confusion() ? 0.0 : aTn / aTd);
|
||||
|
||||
gp_Pnt aClosestPnt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aTc;
|
||||
theDepth = myNearPickedPnt.Distance (aClosestPnt);
|
||||
theDepth = myNearPickedPnt.Distance (aClosestPnt) * myScale;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -109,7 +109,7 @@ void SelectMgr_RectangularFrustum::segmentPlaneIntersection (const gp_Vec& thePl
|
||||
}
|
||||
|
||||
gp_Pnt aClosestPnt = myNearPickedPnt.XYZ() + anU * aParam;
|
||||
theDepth = myNearPickedPnt.Distance (aClosestPnt);
|
||||
theDepth = myNearPickedPnt.Distance (aClosestPnt) * myScale;
|
||||
}
|
||||
|
||||
namespace
|
||||
@@ -275,6 +275,8 @@ void SelectMgr_RectangularFrustum::Build (const gp_Pnt2d &thePoint)
|
||||
// compute vertices projections onto frustum normals and
|
||||
// {i, j, k} vectors and store them to corresponding class fields
|
||||
cacheVertexProjections (this);
|
||||
|
||||
myScale = 1.0;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -301,6 +303,8 @@ void SelectMgr_RectangularFrustum::Build (const gp_Pnt2d& theMinPnt,
|
||||
// compute vertices projections onto frustum normals and
|
||||
// {i, j, k} vectors and store them to corresponding class fields
|
||||
cacheVertexProjections (this);
|
||||
|
||||
myScale = 1.0;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -382,6 +386,8 @@ NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_RectangularFrustum::ScaleAnd
|
||||
aRes->myEdgeDirs[4] = aRes->myVertices[0].XYZ() - aRes->myVertices[1].XYZ();
|
||||
// RightUpper
|
||||
aRes->myEdgeDirs[5] = aRes->myVertices[4].XYZ() - aRes->myVertices[5].XYZ();
|
||||
|
||||
aRes->myScale = 1.0 / theTrsf.ScaleFactor();
|
||||
}
|
||||
|
||||
// compute frustum normals
|
||||
@@ -441,7 +447,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
|
||||
gp_Pnt aDetectedPnt =
|
||||
myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * (aV.Dot (myViewRayDir.XYZ()) / myViewRayDir.Dot (myViewRayDir));
|
||||
|
||||
theDepth = aDetectedPnt.Distance (myNearPickedPnt);
|
||||
theDepth = aDetectedPnt.Distance (myNearPickedPnt) * myScale;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -567,7 +573,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
// handle the case when triangle normal and selecting frustum direction are orthogonal: for this case, overlap
|
||||
// is detected correctly, and distance to triangle's plane can be measured as distance to its arbitrary vertex.
|
||||
const gp_XYZ aDiff = myNearPickedPnt.XYZ() - thePnt1.XYZ();
|
||||
theDepth = aTriangleNormal.Dot (aDiff);
|
||||
theDepth = aTriangleNormal.Dot (aDiff) * myScale;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -585,7 +591,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
if (isInterior)
|
||||
{
|
||||
gp_Pnt aDetectedPnt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aTime;
|
||||
theDepth = myNearPickedPnt.Distance (aDetectedPnt);
|
||||
theDepth = myNearPickedPnt.Distance (aDetectedPnt) * myScale;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -617,7 +623,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
|
||||
// =======================================================================
|
||||
Standard_Real SelectMgr_RectangularFrustum::DistToGeometryCenter (const gp_Pnt& theCOG)
|
||||
{
|
||||
return theCOG.Distance (myNearPickedPnt);
|
||||
return theCOG.Distance (myNearPickedPnt) * myScale;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@@ -33,7 +33,7 @@ class SelectMgr_RectangularFrustum : public SelectMgr_Frustum<4>
|
||||
{
|
||||
public:
|
||||
|
||||
SelectMgr_RectangularFrustum() {};
|
||||
SelectMgr_RectangularFrustum() : myScale (1.0) {};
|
||||
|
||||
//! Builds volume according to the point and given pixel tolerance
|
||||
Standard_EXPORT virtual void Build (const gp_Pnt2d& thePoint) Standard_OVERRIDE;
|
||||
@@ -138,6 +138,7 @@ private:
|
||||
gp_Pnt myFarPickedPnt; //!< 3d projection of user-picked selection point onto far view plane
|
||||
gp_Vec myViewRayDir;
|
||||
gp_Pnt2d myMousePos; //!< Mouse coordinates
|
||||
Standard_Real myScale; //!< Scale factor of applied transformation, if there was any
|
||||
};
|
||||
|
||||
#endif // _SelectMgr_RectangularFrustum_HeaderFile
|
||||
|
@@ -269,27 +269,26 @@ void SelectMgr_ViewerSelector::computeFrustum (const Handle(SelectBasics_Sensiti
|
||||
SelectMgr_FrustumCache& theCachedMgrs,
|
||||
SelectMgr_SelectingVolumeManager& theResMgr)
|
||||
{
|
||||
Standard_Integer aScale = 1;
|
||||
const Standard_Boolean toScale = isToScaleFrustum (theEnt);
|
||||
if (toScale)
|
||||
Standard_Integer aScale = isToScaleFrustum (theEnt) ? sensitivity (theEnt) : 1;
|
||||
const gp_Trsf aTrsfMtr = theEnt->HasInitLocation() ? theEnt->InvInitLocation() * theInvTrsf : theInvTrsf;
|
||||
const Standard_Boolean toScale = aScale != 1;
|
||||
const Standard_Boolean toTransform = aTrsfMtr.Form() != gp_Identity;
|
||||
if (toScale && toTransform)
|
||||
{
|
||||
aScale = sensitivity (theEnt);
|
||||
}
|
||||
if (theEnt->HasInitLocation())
|
||||
{
|
||||
theResMgr =
|
||||
mySelectingVolumeMgr.ScaleAndTransform (aScale, theEnt->InvInitLocation() * theInvTrsf);
|
||||
theResMgr = mySelectingVolumeMgr.ScaleAndTransform (aScale, aTrsfMtr);
|
||||
}
|
||||
else if (toScale)
|
||||
{
|
||||
if (!theCachedMgrs.IsBound (aScale))
|
||||
{
|
||||
theCachedMgrs.Bind (aScale,
|
||||
mySelectingVolumeMgr.ScaleAndTransform(aScale, theInvTrsf));
|
||||
theCachedMgrs.Bind (aScale, mySelectingVolumeMgr.ScaleAndTransform (aScale, gp_Trsf()));
|
||||
}
|
||||
|
||||
theResMgr = theCachedMgrs.Find (aScale);
|
||||
}
|
||||
else if (toTransform)
|
||||
{
|
||||
theResMgr = mySelectingVolumeMgr.ScaleAndTransform (1, aTrsfMtr);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -288,6 +288,7 @@ static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN";
|
||||
#include <StepBasic_SecurityClassificationLevel.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectTransition.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
@@ -722,6 +723,10 @@ static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN";
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
#include <StepVisual_AnnotationPlane.hxx>
|
||||
#include <StepVisual_DraughtingCallout.hxx>
|
||||
|
||||
|
||||
static int init = 0;
|
||||
@@ -740,7 +745,7 @@ StepAP214_Protocol::StepAP214_Protocol ()
|
||||
types.Bind (STANDARD_TYPE(StepBasic_Address), 1);
|
||||
types.Bind (STANDARD_TYPE(StepShape_AdvancedBrepShapeRepresentation), 2);
|
||||
types.Bind (STANDARD_TYPE(StepShape_AdvancedFace), 3);
|
||||
// types.Bind (STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence), 4);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence), 4);
|
||||
// types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillArea), 5);
|
||||
// types.Bind (STANDARD_TYPE(StepVisual_AnnotationFillAreaOccurrence), 6);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_AnnotationOccurrence), 7);
|
||||
@@ -840,7 +845,7 @@ StepAP214_Protocol::StepAP214_Protocol ()
|
||||
types.Bind (STANDARD_TYPE(StepBasic_DimensionalExponents), 104);
|
||||
types.Bind (STANDARD_TYPE(StepGeom_Direction), 105);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_DraughtingAnnotationOccurrence), 106);
|
||||
// types.Bind (STANDARD_TYPE(StepVisual_DraughtingCallout), 107);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_DraughtingCallout), 107);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_DraughtingPreDefinedColour), 108);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_DraughtingPreDefinedCurveFont), 109);
|
||||
// types.Bind (STANDARD_TYPE(StepVisual_DraughtingSubfigureRepresentation), 110);
|
||||
@@ -1411,6 +1416,9 @@ StepAP214_Protocol::StepAP214_Protocol ()
|
||||
types.Bind (STANDARD_TYPE(StepRepr_CompShAspAndDatumFeatAndShAsp), 699);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_IntegerRepresentationItem), 700);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_ValueRepresentationItem), 701);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_FeatureForDatumTargetRelationship), 702);
|
||||
types.Bind (STANDARD_TYPE(StepAP242_DraughtingModelItemAssociation), 703);
|
||||
types.Bind (STANDARD_TYPE(StepVisual_AnnotationPlane), 704);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -1,3 +1,5 @@
|
||||
StepAP242_DraughtingModelItemAssociation.cxx
|
||||
StepAP242_DraughtingModelItemAssociation.hxx
|
||||
StepAP242_GeometricItemSpecificUsage.cxx
|
||||
StepAP242_GeometricItemSpecificUsage.hxx
|
||||
StepAP242_IdAttribute.cxx
|
||||
|
18
src/StepAP242/StepAP242_DraughtingModelItemAssociation.cxx
Normal file
18
src/StepAP242/StepAP242_DraughtingModelItemAssociation.cxx
Normal file
@@ -0,0 +1,18 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
|
||||
StepAP242_DraughtingModelItemAssociation::StepAP242_DraughtingModelItemAssociation () { }
|
37
src/StepAP242/StepAP242_DraughtingModelItemAssociation.hxx
Normal file
37
src/StepAP242/StepAP242_DraughtingModelItemAssociation.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepAP242_DraughtingModelItemAssociation_HeaderFile
|
||||
#define _StepAP242_DraughtingModelItemAssociation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepAP242_ItemIdentifiedRepresentationUsage.hxx>
|
||||
|
||||
class StepAP242_DraughtingModelItemAssociation;
|
||||
DEFINE_STANDARD_HANDLE(StepAP242_DraughtingModelItemAssociation, StepAP242_ItemIdentifiedRepresentationUsage)
|
||||
//! Added for Dimensional Tolerances
|
||||
class StepAP242_DraughtingModelItemAssociation : public StepAP242_ItemIdentifiedRepresentationUsage
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT StepAP242_DraughtingModelItemAssociation();
|
||||
|
||||
DEFINE_STANDARD_RTTI(StepAP242_DraughtingModelItemAssociation, StepAP242_ItemIdentifiedRepresentationUsage)
|
||||
|
||||
};
|
||||
#endif // _StepAP242_DraughtingModelItemAssociation_HeaderFile
|
@@ -55,7 +55,7 @@ public:
|
||||
}
|
||||
|
||||
//! Set field DefiningTolerance
|
||||
inline void SetModifiers (const Handle(StepDimTol_HArray1OfToleranceZoneTarget) &theDefiningTolerance)
|
||||
inline void SetDefiningTolerance (const Handle(StepDimTol_HArray1OfToleranceZoneTarget) &theDefiningTolerance)
|
||||
{
|
||||
definingTolerance = theDefiningTolerance;
|
||||
}
|
||||
|
@@ -48,6 +48,8 @@ StepRepr_Extension.cxx
|
||||
StepRepr_Extension.hxx
|
||||
StepRepr_ExternallyDefinedRepresentation.cxx
|
||||
StepRepr_ExternallyDefinedRepresentation.hxx
|
||||
StepRepr_FeatureForDatumTargetRelationship.cxx
|
||||
StepRepr_FeatureForDatumTargetRelationship.hxx
|
||||
StepRepr_FunctionallyDefinedTransformation.cxx
|
||||
StepRepr_FunctionallyDefinedTransformation.hxx
|
||||
StepRepr_GeometricAlignment.cxx
|
||||
|
29
src/StepRepr/StepRepr_FeatureForDatumTargetRelationship.cxx
Normal file
29
src/StepRepr/StepRepr_FeatureForDatumTargetRelationship.cxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : StepRepr_FeatureForDatumtargetRelationship
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StepRepr_FeatureForDatumTargetRelationship::StepRepr_FeatureForDatumTargetRelationship ()
|
||||
{
|
||||
}
|
59
src/StepRepr/StepRepr_FeatureForDatumTargetRelationship.hxx
Normal file
59
src/StepRepr/StepRepr_FeatureForDatumTargetRelationship.hxx
Normal file
@@ -0,0 +1,59 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
|
||||
#define _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
|
||||
|
||||
class StepRepr_FeatureForDatumTargetRelationship;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_FeatureForDatumTargetRelationship, StepRepr_ShapeAspectRelationship)
|
||||
|
||||
//! Representation of STEP entity DimensionalLocation
|
||||
class StepRepr_FeatureForDatumTargetRelationship : public StepRepr_ShapeAspectRelationship
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT StepRepr_FeatureForDatumTargetRelationship();
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(StepRepr_FeatureForDatumTargetRelationship,StepRepr_ShapeAspectRelationship)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
|
@@ -15,6 +15,7 @@
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <StepShape_PrecisionQualifier.hxx>
|
||||
#include <StepShape_TypeQualifier.hxx>
|
||||
#include <StepShape_ValueFormatTypeQualifier.hxx>
|
||||
#include <StepShape_ValueQualifier.hxx>
|
||||
|
||||
StepShape_ValueQualifier::StepShape_ValueQualifier () { }
|
||||
@@ -33,3 +34,6 @@ Handle(StepShape_PrecisionQualifier) StepShape_ValueQualifier::PrecisionQualifi
|
||||
|
||||
Handle(StepShape_TypeQualifier) StepShape_ValueQualifier::TypeQualifier () const
|
||||
{ return Handle(StepShape_TypeQualifier)::DownCast(Value()); }
|
||||
|
||||
Handle(StepShape_ValueFormatTypeQualifier) StepShape_ValueQualifier::ValueFormatTypeQualifier () const
|
||||
{ return Handle(StepShape_ValueFormatTypeQualifier)::DownCast(Value()); }
|
@@ -25,6 +25,7 @@
|
||||
class Standard_Transient;
|
||||
class StepShape_PrecisionQualifier;
|
||||
class StepShape_TypeQualifier;
|
||||
class StepShape_ValueFormatTypeQualifier;
|
||||
|
||||
|
||||
//! Added for Dimensional Tolerances
|
||||
@@ -49,6 +50,9 @@ public:
|
||||
//! Returns Value as TypeQualifier
|
||||
Standard_EXPORT Handle(StepShape_TypeQualifier) TypeQualifier() const;
|
||||
|
||||
//! Returns Value as ValueFormatTypeQualifier
|
||||
Standard_EXPORT Handle(StepShape_ValueFormatTypeQualifier) ValueFormatTypeQualifier() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,5 +1,11 @@
|
||||
StepVisual_AnnotationCurveOccurrence.cxx
|
||||
StepVisual_AnnotationCurveOccurrence.hxx
|
||||
StepVisual_AnnotationOccurrence.cxx
|
||||
StepVisual_AnnotationOccurrence.hxx
|
||||
StepVisual_AnnotationPlane.cxx
|
||||
StepVisual_AnnotationPlane.hxx
|
||||
StepVisual_AnnotationPlaneElement.cxx
|
||||
StepVisual_AnnotationPlaneElement.hxx
|
||||
StepVisual_AnnotationText.cxx
|
||||
StepVisual_AnnotationText.hxx
|
||||
StepVisual_AnnotationTextOccurrence.cxx
|
||||
@@ -8,9 +14,11 @@ StepVisual_AreaInSet.cxx
|
||||
StepVisual_AreaInSet.hxx
|
||||
StepVisual_AreaOrView.cxx
|
||||
StepVisual_AreaOrView.hxx
|
||||
StepVisual_Array1OfAnnotationPlaneElement.hxx
|
||||
StepVisual_Array1OfBoxCharacteristicSelect.hxx
|
||||
StepVisual_Array1OfCurveStyleFontPattern.hxx
|
||||
StepVisual_Array1OfDirectionCountSelect.hxx
|
||||
StepVisual_Array1OfDraughtingCalloutElement.hxx
|
||||
StepVisual_Array1OfFillStyleSelect.hxx
|
||||
StepVisual_Array1OfInvisibleItem.hxx
|
||||
StepVisual_Array1OfLayeredItem.hxx
|
||||
@@ -64,6 +72,10 @@ StepVisual_DirectionCountSelect.cxx
|
||||
StepVisual_DirectionCountSelect.hxx
|
||||
StepVisual_DraughtingAnnotationOccurrence.cxx
|
||||
StepVisual_DraughtingAnnotationOccurrence.hxx
|
||||
StepVisual_DraughtingCallout.cxx
|
||||
StepVisual_DraughtingCallout.hxx
|
||||
StepVisual_DraughtingCalloutElement.cxx
|
||||
StepVisual_DraughtingCalloutElement.hxx
|
||||
StepVisual_DraughtingModel.cxx
|
||||
StepVisual_DraughtingModel.hxx
|
||||
StepVisual_DraughtingPreDefinedColour.cxx
|
||||
@@ -82,9 +94,11 @@ StepVisual_FillStyleSelect.cxx
|
||||
StepVisual_FillStyleSelect.hxx
|
||||
StepVisual_FontSelect.cxx
|
||||
StepVisual_FontSelect.hxx
|
||||
StepVisual_HArray1OfAnnotationPlaneElement.hxx
|
||||
StepVisual_HArray1OfBoxCharacteristicSelect.hxx
|
||||
StepVisual_HArray1OfCurveStyleFontPattern.hxx
|
||||
StepVisual_HArray1OfDirectionCountSelect.hxx
|
||||
StepVisual_HArray1OfDraughtingCalloutElement.hxx
|
||||
StepVisual_HArray1OfFillStyleSelect.hxx
|
||||
StepVisual_HArray1OfInvisibleItem.hxx
|
||||
StepVisual_HArray1OfLayeredItem.hxx
|
||||
|
20
src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx
Normal file
20
src/StepVisual/StepVisual_AnnotationCurveOccurrence.cxx
Normal file
@@ -0,0 +1,20 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
|
||||
StepVisual_AnnotationCurveOccurrence::StepVisual_AnnotationCurveOccurrence () {}
|
||||
|
36
src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx
Normal file
36
src/StepVisual/StepVisual_AnnotationCurveOccurrence.hxx
Normal file
@@ -0,0 +1,36 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_AnnotationCurveOccurrence_HeaderFile
|
||||
#define _StepVisual_AnnotationCurveOccurrence_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepVisual_StyledItem.hxx>
|
||||
|
||||
class StepVisual_AnnotationCurveOccurrence;
|
||||
DEFINE_STANDARD_HANDLE(StepVisual_AnnotationCurveOccurrence, StepVisual_StyledItem)
|
||||
|
||||
class StepVisual_AnnotationCurveOccurrence : public StepVisual_StyledItem
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns a AnnotationCurveOccurrence
|
||||
Standard_EXPORT StepVisual_AnnotationCurveOccurrence();
|
||||
|
||||
DEFINE_STANDARD_RTTI(StepVisual_AnnotationCurveOccurrence,StepVisual_StyledItem)
|
||||
};
|
||||
#endif // _StepVisual_AnnotationCurveOccurrence_HeaderFile
|
36
src/StepVisual/StepVisual_AnnotationPlane.cxx
Normal file
36
src/StepVisual/StepVisual_AnnotationPlane.cxx
Normal file
@@ -0,0 +1,36 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepVisual_AnnotationPlane.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : StepVisual_AnnotationPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StepVisual_AnnotationPlane::StepVisual_AnnotationPlane () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepVisual_AnnotationPlane::Init (const Handle(TCollection_HAsciiString)& theName,
|
||||
const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& theStyles,
|
||||
const Handle(StepRepr_RepresentationItem)& theItem,
|
||||
const Handle(StepVisual_HArray1OfAnnotationPlaneElement)& theElements)
|
||||
{
|
||||
StepVisual_AnnotationOccurrence::Init(theName, theStyles, theItem);
|
||||
myElements = theElements;
|
||||
}
|
76
src/StepVisual/StepVisual_AnnotationPlane.hxx
Normal file
76
src/StepVisual/StepVisual_AnnotationPlane.hxx
Normal file
@@ -0,0 +1,76 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_AnnotationPlane_HeaderFile
|
||||
#define _StepVisual_AnnotationPlane_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepVisual_AnnotationOccurrence.hxx>
|
||||
#include <StepVisual_HArray1OfAnnotationPlaneElement.hxx>
|
||||
|
||||
class StepVisual_AnnotationPlane;
|
||||
DEFINE_STANDARD_HANDLE(StepVisual_AnnotationPlane, StepVisual_AnnotationOccurrence)
|
||||
|
||||
class StepVisual_AnnotationPlane : public StepVisual_AnnotationOccurrence
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns a AnnotationPlane
|
||||
Standard_EXPORT StepVisual_AnnotationPlane();
|
||||
|
||||
Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& theName,
|
||||
const Handle(StepVisual_HArray1OfPresentationStyleAssignment)& theStyles,
|
||||
const Handle(StepRepr_RepresentationItem)& theItem,
|
||||
const Handle(StepVisual_HArray1OfAnnotationPlaneElement)& theElements);
|
||||
|
||||
//! Returns field Elements
|
||||
inline Handle(StepVisual_HArray1OfAnnotationPlaneElement) Elements () const
|
||||
{
|
||||
return myElements;
|
||||
}
|
||||
|
||||
//! Set field Elements
|
||||
inline void SetElements (const Handle(StepVisual_HArray1OfAnnotationPlaneElement) &theElements)
|
||||
{
|
||||
myElements = theElements;
|
||||
}
|
||||
|
||||
//! Returns number of Elements
|
||||
inline Standard_Integer NbElements () const
|
||||
{
|
||||
return (myElements.IsNull() ? 0 : myElements->Length());
|
||||
}
|
||||
|
||||
//! Returns Elements with the given number
|
||||
inline StepVisual_AnnotationPlaneElement ElementsValue(const Standard_Integer theNum) const
|
||||
{
|
||||
return myElements->Value(theNum);
|
||||
}
|
||||
|
||||
//! Sets Elements with given number
|
||||
inline void SetElementsValue(const Standard_Integer theNum, const StepVisual_AnnotationPlaneElement& theItem)
|
||||
{
|
||||
myElements->SetValue (theNum, theItem);
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI(StepVisual_AnnotationPlane,StepVisual_AnnotationOccurrence)
|
||||
|
||||
private:
|
||||
|
||||
Handle(StepVisual_HArray1OfAnnotationPlaneElement) myElements;
|
||||
};
|
||||
#endif // _StepVisual_AnnotationPlane_HeaderFile
|
45
src/StepVisual/StepVisual_AnnotationPlaneElement.cxx
Normal file
45
src/StepVisual/StepVisual_AnnotationPlaneElement.cxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Created on: 2015-07-10
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StepVisual_AnnotationPlaneElement.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <StepVisual_DraughtingCallout.hxx>
|
||||
#include <StepVisual_StyledItem.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : StepVisual_AnnotationPlaneElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StepVisual_AnnotationPlaneElement::StepVisual_AnnotationPlaneElement () { }
|
||||
|
||||
//=======================================================================
|
||||
//function : CaseNum
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer StepVisual_AnnotationPlaneElement::CaseNum(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
if (ent.IsNull()) return 0;
|
||||
if (ent->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) return 1;
|
||||
if (ent->IsKind(STANDARD_TYPE(StepVisual_StyledItem))) return 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(StepVisual_DraughtingCallout) StepVisual_AnnotationPlaneElement::DraughtingCallout() const
|
||||
{ return GetCasted(StepVisual_DraughtingCallout,Value()); }
|
||||
|
||||
Handle(StepVisual_StyledItem) StepVisual_AnnotationPlaneElement::StyledItem() const
|
||||
{ return GetCasted(StepVisual_StyledItem,Value()); }
|
50
src/StepVisual/StepVisual_AnnotationPlaneElement.hxx
Normal file
50
src/StepVisual/StepVisual_AnnotationPlaneElement.hxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_AnnotationPlaneElement_HeaderFile
|
||||
#define _StepVisual_AnnotationPlaneElement_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <StepData_SelectType.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_Transient;
|
||||
class StepVisual_DraughtingCallout;
|
||||
class StepVisual_StyledItem;
|
||||
|
||||
class StepVisual_AnnotationPlaneElement : public StepData_SelectType
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Returns a AnnotationPlaneElement select type
|
||||
Standard_EXPORT StepVisual_AnnotationPlaneElement();
|
||||
|
||||
//! Recognizes a IdAttributeSelect Kind Entity that is :
|
||||
//! 1 -> DraughtingCallout
|
||||
//! 2 -> StyledItem
|
||||
//! 0 else
|
||||
Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! returns Value as a DraughtingCallout (Null if another type)
|
||||
Standard_EXPORT Handle(StepVisual_DraughtingCallout) DraughtingCallout() const;
|
||||
|
||||
//! returns Value as a StyledItem (Null if another type)
|
||||
Standard_EXPORT Handle(StepVisual_StyledItem) StyledItem() const;
|
||||
};
|
||||
#endif // StepVisual_AnnotationPlaneElement
|
23
src/StepVisual/StepVisual_Array1OfAnnotationPlaneElement.hxx
Normal file
23
src/StepVisual/StepVisual_Array1OfAnnotationPlaneElement.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_Array1OfAnnotationPlaneElement_HeaderFile
|
||||
#define _StepVisual_Array1OfAnnotationPlaneElement_HeaderFile
|
||||
|
||||
#include <StepVisual_AnnotationPlaneElement.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
typedef NCollection_Array1<StepVisual_AnnotationPlaneElement> StepVisual_Array1OfAnnotationPlaneElement;
|
||||
#endif // _StepVisual_Array1OfAnnotationPlaneElement_HeaderFile
|
@@ -0,0 +1,23 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_Array1OfDraughtingCalloutElement_HeaderFile
|
||||
#define _StepVisual_Array1OfDraughtingCalloutElement_HeaderFile
|
||||
|
||||
#include <StepVisual_DraughtingCalloutElement.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
typedef NCollection_Array1<StepVisual_DraughtingCalloutElement> StepVisual_Array1OfDraughtingCalloutElement;
|
||||
#endif // _StepVisual_Array1OfDraughtingCalloutElement_HeaderFile
|
36
src/StepVisual/StepVisual_DraughtingCallout.cxx
Normal file
36
src/StepVisual/StepVisual_DraughtingCallout.cxx
Normal file
@@ -0,0 +1,36 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepVisual_DraughtingCallout.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : StepVisual_DraughtingCallout
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StepVisual_DraughtingCallout::StepVisual_DraughtingCallout () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepVisual_DraughtingCallout::Init (const Handle(TCollection_HAsciiString)& theName,
|
||||
const Handle(StepVisual_HArray1OfDraughtingCalloutElement)& theContents)
|
||||
{
|
||||
StepGeom_GeometricRepresentationItem::Init(theName);
|
||||
myContents = theContents;
|
||||
}
|
||||
|
77
src/StepVisual/StepVisual_DraughtingCallout.hxx
Normal file
77
src/StepVisual/StepVisual_DraughtingCallout.hxx
Normal file
@@ -0,0 +1,77 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_DraughtingCallout_HeaderFile
|
||||
#define _StepVisual_DraughtingCallout_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepGeom_GeometricRepresentationItem.hxx>
|
||||
#include <StepVisual_HArray1OfDraughtingCalloutElement.hxx>
|
||||
|
||||
|
||||
class StepVisual_DraughtingCallout;
|
||||
DEFINE_STANDARD_HANDLE(StepVisual_DraughtingCallout, StepGeom_GeometricRepresentationItem)
|
||||
|
||||
|
||||
class StepVisual_DraughtingCallout : public StepGeom_GeometricRepresentationItem
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns a DraughtingCallout
|
||||
Standard_EXPORT StepVisual_DraughtingCallout();
|
||||
|
||||
//! Init
|
||||
Standard_EXPORT void StepVisual_DraughtingCallout::Init (const Handle(TCollection_HAsciiString)& theName,
|
||||
const Handle(StepVisual_HArray1OfDraughtingCalloutElement)& theContents);
|
||||
|
||||
//! Returns field Contents
|
||||
inline Handle(StepVisual_HArray1OfDraughtingCalloutElement) Contents () const
|
||||
{
|
||||
return myContents;
|
||||
}
|
||||
|
||||
//! Set field Contents
|
||||
inline void SetContents (const Handle(StepVisual_HArray1OfDraughtingCalloutElement) &theContents)
|
||||
{
|
||||
myContents = theContents;
|
||||
}
|
||||
|
||||
//! Returns number of Contents
|
||||
inline Standard_Integer NbContents () const
|
||||
{
|
||||
return (myContents.IsNull() ? 0 : myContents->Length());
|
||||
}
|
||||
|
||||
//! Returns Contents with the given number
|
||||
inline StepVisual_DraughtingCalloutElement ContentsValue(const Standard_Integer theNum) const
|
||||
{
|
||||
return myContents->Value(theNum);
|
||||
}
|
||||
|
||||
//! Sets Contents with given number
|
||||
inline void SetContentsValue(const Standard_Integer theNum, const StepVisual_DraughtingCalloutElement& theItem)
|
||||
{
|
||||
myContents->SetValue (theNum, theItem);
|
||||
}
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(StepVisual_DraughtingCallout,StepGeom_GeometricRepresentationItem)
|
||||
|
||||
private:
|
||||
Handle(StepVisual_HArray1OfDraughtingCalloutElement) myContents;
|
||||
};
|
||||
#endif // _StepVisual_DraughtingCallout_HeaderFile
|
40
src/StepVisual/StepVisual_DraughtingCalloutElement.cxx
Normal file
40
src/StepVisual/StepVisual_DraughtingCalloutElement.cxx
Normal file
@@ -0,0 +1,40 @@
|
||||
// Created on: 2015-07-10
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StepVisual_DraughtingCalloutElement.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : StepVisual_DraughtingCalloutElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
StepVisual_DraughtingCalloutElement::StepVisual_DraughtingCalloutElement () { }
|
||||
|
||||
//=======================================================================
|
||||
//function : CaseNum
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer StepVisual_DraughtingCalloutElement::CaseNum(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
if (ent.IsNull()) return 0;
|
||||
if (ent->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(StepVisual_AnnotationCurveOccurrence) StepVisual_DraughtingCalloutElement::AnnotationCurveOccurrence() const
|
||||
{ return GetCasted(StepVisual_AnnotationCurveOccurrence,Value()); }
|
45
src/StepVisual/StepVisual_DraughtingCalloutElement.hxx
Normal file
45
src/StepVisual/StepVisual_DraughtingCalloutElement.hxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_DraughtingCalloutElement_HeaderFile
|
||||
#define _StepVisual_DraughtingCalloutElement_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <StepData_SelectType.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_Transient;
|
||||
class StepVisual_AnnotationCurveOccurrence;
|
||||
|
||||
class StepVisual_DraughtingCalloutElement : public StepData_SelectType
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Returns a DraughtingCalloutElement select type
|
||||
Standard_EXPORT StepVisual_DraughtingCalloutElement();
|
||||
|
||||
//! Recognizes a IdAttributeSelect Kind Entity that is :
|
||||
//! 1 -> AnnotationCurveOccurrence
|
||||
//! 0 else
|
||||
Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! returns Value as a AnnotationCurveOccurrence (Null if another type)
|
||||
Standard_EXPORT Handle(StepVisual_AnnotationCurveOccurrence) AnnotationCurveOccurrence() const;
|
||||
};
|
||||
#endif // StepVisual_DraughtingCalloutElement
|
@@ -0,0 +1,24 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_HArray1OfAnnotationPlaneElement_HeaderFile
|
||||
#define _StepVisual_HArray1OfAnnotationPlaneElement_HeaderFile
|
||||
|
||||
#include <StepVisual_AnnotationPlaneElement.hxx>
|
||||
#include <StepVisual_Array1OfAnnotationPlaneElement.hxx>
|
||||
#include <NCollection_DefineHArray1.hxx>
|
||||
|
||||
DEFINE_HARRAY1(StepVisual_HArray1OfAnnotationPlaneElement, StepVisual_Array1OfAnnotationPlaneElement)
|
||||
#endif // _StepVisual_HArray1OfAnnotationPlaneElement_HeaderFile
|
@@ -0,0 +1,24 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepVisual_HArray1OfDraughtingCalloutElement_HeaderFile
|
||||
#define _StepVisual_HArray1OfDraughtingCalloutElement_HeaderFile
|
||||
|
||||
#include <StepVisual_DraughtingCalloutElement.hxx>
|
||||
#include <StepVisual_Array1OfDraughtingCalloutElement.hxx>
|
||||
#include <NCollection_DefineHArray1.hxx>
|
||||
|
||||
DEFINE_HARRAY1(StepVisual_HArray1OfDraughtingCalloutElement, StepVisual_Array1OfDraughtingCalloutElement)
|
||||
#endif // _StepVisual_HArray1OfDraughtingCalloutElement_HeaderFile
|
@@ -976,10 +976,10 @@ public:
|
||||
Standard_EXPORT const Handle(Graphic3d_Camera)& Camera() const;
|
||||
|
||||
//! Returns current rendering parameters and effect settings.
|
||||
Standard_EXPORT const Graphic3d_RenderingParams& RenderingParams() const;
|
||||
Standard_EXPORT const Handle(Graphic3d_RenderingParams)& RenderingParams() const;
|
||||
|
||||
//! Returns reference to current rendering parameters and effect settings.
|
||||
Standard_EXPORT Graphic3d_RenderingParams& ChangeRenderingParams();
|
||||
Standard_EXPORT Handle(Graphic3d_RenderingParams)& ChangeRenderingParams();
|
||||
|
||||
//! @return flag value of objects culling mechanism
|
||||
Standard_EXPORT Standard_Boolean IsCullingEnabled() const;
|
||||
|
@@ -65,7 +65,7 @@ Standard_Boolean V3d_View::IsGLLightEnabled() const
|
||||
//function : RenderingParams
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
const Graphic3d_RenderingParams& V3d_View::RenderingParams() const
|
||||
const Handle(Graphic3d_RenderingParams)& V3d_View::RenderingParams() const
|
||||
{
|
||||
return myView->RenderingParams();
|
||||
}
|
||||
@@ -74,7 +74,7 @@ const Graphic3d_RenderingParams& V3d_View::RenderingParams() const
|
||||
//function : ChangeRenderingParams
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Graphic3d_RenderingParams& V3d_View::ChangeRenderingParams()
|
||||
Handle(Graphic3d_RenderingParams)& V3d_View::ChangeRenderingParams()
|
||||
{
|
||||
return myView->ChangeRenderingParams();
|
||||
}
|
||||
|
@@ -86,6 +86,9 @@ myZLayerGenId (1, IntegerLast())
|
||||
myRGrid = new V3d_RectangularGrid (this, Color1, Color2);
|
||||
myCGrid = new V3d_CircularGrid (this, Color1, Color2);
|
||||
myGridType = Aspect_GT_Rectangular;
|
||||
|
||||
// Create the default rendering params.
|
||||
myDefaultRenderingParams = new Graphic3d_RenderingParams();
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
@@ -94,7 +97,10 @@ myZLayerGenId (1, IntegerLast())
|
||||
// ========================================================================
|
||||
Handle(V3d_View) V3d_Viewer::CreateView ()
|
||||
{
|
||||
return new V3d_View(this, MyDefaultTypeOfView);
|
||||
Handle(V3d_View) aNewView = new V3d_View(this, MyDefaultTypeOfView);
|
||||
aNewView->ChangeRenderingParams() = myDefaultRenderingParams;
|
||||
|
||||
return aNewView;
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
@@ -534,3 +540,12 @@ void V3d_Viewer::IncrCount()
|
||||
{
|
||||
myNextCount++;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DefaultRenderingParams
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Graphic3d_RenderingParams)& V3d_Viewer::DefaultRenderingParams()
|
||||
{
|
||||
return myDefaultRenderingParams;
|
||||
}
|
||||
|
@@ -439,6 +439,8 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_CString Domain() const;
|
||||
|
||||
Standard_EXPORT Handle(Graphic3d_RenderingParams)& DefaultRenderingParams();
|
||||
|
||||
friend class V3d_View;
|
||||
friend class V3d_Light;
|
||||
|
||||
@@ -505,6 +507,8 @@ private:
|
||||
Graphic3d_Vertex myGridEchoLastVert;
|
||||
TColStd_MapOfInteger myLayerIds;
|
||||
Aspect_GenId myZLayerGenId;
|
||||
|
||||
Handle(Graphic3d_RenderingParams) myDefaultRenderingParams;
|
||||
};
|
||||
|
||||
#endif // _V3d_Viewer_HeaderFile
|
||||
|
@@ -4428,17 +4428,42 @@ static Standard_Integer VState (Draw_Interpretor& theDI,
|
||||
{
|
||||
theDI << "Detected entities:\n";
|
||||
Handle(StdSelect_ViewerSelector3d) aSelector = aCtx->HasOpenedContext() ? aCtx->LocalSelector() : aCtx->MainSelector();
|
||||
SelectMgr_SelectingVolumeManager aMgr = aSelector->GetManager();
|
||||
for (aSelector->InitDetected(); aSelector->MoreDetected(); aSelector->NextDetected())
|
||||
{
|
||||
const Handle(SelectBasics_SensitiveEntity)& anEntity = aSelector->DetectedEntity();
|
||||
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId());
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
SelectMgr_SelectingVolumeManager aMgr =
|
||||
anObj->HasTransformation() ? aSelector->GetManager().ScaleAndTransform (1, anObj->InversedTransformation())
|
||||
: aSelector->GetManager();
|
||||
gp_Trsf anInvTrsf;
|
||||
if (anObj->TransformPersistence().Flags)
|
||||
{
|
||||
const Graphic3d_Mat4d& aProjection = aMgr.ProjectionMatrix();
|
||||
const Graphic3d_Mat4d& aWorldView = aMgr.WorldViewMatrix();
|
||||
|
||||
Graphic3d_Mat4d aMat = anObj->TransformPersistence().Compute (aProjection, aWorldView, 0, 0);
|
||||
anInvTrsf.SetValues (aMat.GetValue (0, 0), aMat.GetValue (0, 1), aMat.GetValue (0, 2), aMat.GetValue (0, 3),
|
||||
aMat.GetValue (1, 0), aMat.GetValue (1, 1), aMat.GetValue (1, 2), aMat.GetValue (1, 3),
|
||||
aMat.GetValue (2, 0), aMat.GetValue (2, 1), aMat.GetValue (2, 2), aMat.GetValue (2, 3));
|
||||
anInvTrsf.Invert();
|
||||
}
|
||||
if (anObj->HasTransformation())
|
||||
{
|
||||
anInvTrsf = anObj->InversedTransformation() * anInvTrsf;
|
||||
}
|
||||
if (anEntity->HasInitLocation())
|
||||
{
|
||||
anInvTrsf = anEntity->InvInitLocation() * anInvTrsf;
|
||||
}
|
||||
const Standard_Integer aScale = anEntity->SensitivityFactor() < aSelector->PixelTolerance()
|
||||
? anEntity->SensitivityFactor() : 1;
|
||||
const Standard_Boolean isToScaleAndTransform = anInvTrsf.Form() != gp_Identity || aScale != 1;
|
||||
SelectMgr_SelectingVolumeManager anEntMgr =
|
||||
isToScaleAndTransform ? aMgr.ScaleAndTransform (aScale, anInvTrsf)
|
||||
: aMgr;
|
||||
SelectBasics_PickResult aResult;
|
||||
anEntity->Matches (aMgr, aResult);
|
||||
gp_Pnt aDetectedPnt = aMgr.DetectedPoint (aResult.Depth());
|
||||
anEntity->Matches (anEntMgr, aResult);
|
||||
gp_Pnt aDetectedPnt = anInvTrsf.Form() == gp_Identity ?
|
||||
anEntMgr.DetectedPoint (aResult.Depth()) : anEntMgr.DetectedPoint (aResult.Depth()).Transformed (anInvTrsf.Inverted());
|
||||
|
||||
TCollection_AsciiString aName = GetMapOfAIS().Find1 (anObj);
|
||||
aName.LeftJustify (20, ' ');
|
||||
|
@@ -128,6 +128,7 @@
|
||||
#include <BRepExtrema_ExtPC.hxx>
|
||||
#include <BRepExtrema_ExtPF.hxx>
|
||||
|
||||
#include <Prs3d_DatumAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_VertexDrawMode.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
@@ -136,6 +137,7 @@
|
||||
|
||||
#include <Image_AlienPixMap.hxx>
|
||||
#include <TColStd_HArray1OfAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfAsciiString.hxx>
|
||||
|
||||
#ifdef _WIN32
|
||||
# define _CRT_SECURE_NO_DEPRECATE
|
||||
@@ -241,47 +243,126 @@ static int VTrihedron2D (Draw_Interpretor& di, Standard_Integer argc, const char
|
||||
//Draw arg : vtrihedron name [Xo] [Yo] [Zo] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
|
||||
//==============================================================================
|
||||
|
||||
static int VTrihedron (Draw_Interpretor& theDi,
|
||||
static int VTrihedron (Draw_Interpretor& /*theDi*/,
|
||||
Standard_Integer theArgsNb,
|
||||
const char** theArgVec)
|
||||
{
|
||||
if (theArgsNb != 2 && theArgsNb != 5 && theArgsNb != 11)
|
||||
if (theArgsNb < 2 || theArgsNb > 11)
|
||||
{
|
||||
theDi << theArgVec[0] << " Syntax error\n";
|
||||
std::cout << theArgVec[0] << " syntax error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Parse parameters
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(TColStd_HSequenceOfAsciiString)> aMapOfArgs;
|
||||
TCollection_AsciiString aParseKey;
|
||||
for (Standard_Integer anArgIt = 1; anArgIt < theArgsNb; ++anArgIt)
|
||||
{
|
||||
TCollection_AsciiString anArg (theArgVec [anArgIt]);
|
||||
|
||||
if (anArg.Value (1) == '-' && !anArg.IsRealValue())
|
||||
{
|
||||
aParseKey = anArg;
|
||||
aParseKey.Remove (1);
|
||||
aParseKey.LowerCase();
|
||||
aMapOfArgs.Bind (aParseKey, new TColStd_HSequenceOfAsciiString);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aParseKey.IsEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
aMapOfArgs(aParseKey)->Append (anArg);
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ( (aMapOfArgs.IsBound ("xaxis") && !aMapOfArgs.IsBound ("zaxis"))
|
||||
|| (!aMapOfArgs.IsBound ("xaxis") && aMapOfArgs.IsBound ("zaxis")) )
|
||||
{
|
||||
std::cout << theArgVec[0] << " error: -xaxis and -yaxis parameters are to set together.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (NCollection_DataMap<TCollection_AsciiString, Handle(TColStd_HSequenceOfAsciiString)>::Iterator aMapIt (aMapOfArgs);
|
||||
aMapIt.More(); aMapIt.Next())
|
||||
{
|
||||
const TCollection_AsciiString& aKey = aMapIt.Key();
|
||||
const Handle(TColStd_HSequenceOfAsciiString)& anArgs = aMapIt.Value();
|
||||
|
||||
// Bool key, without arguments
|
||||
if (aKey.IsEqual ("hidelabels") && anArgs->IsEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( (aKey.IsEqual ("xaxis") || aKey.IsEqual ("zaxis") || aKey.IsEqual ("origin")) && anArgs->Length() == 3
|
||||
&& anArgs->Value(1).IsRealValue() && anArgs->Value(2).IsRealValue() && anArgs->Value(3).IsRealValue() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Process parameters
|
||||
gp_Pnt anOrigin (0.0, 0.0, 0.0);
|
||||
gp_Dir aDirZ = gp::DZ();
|
||||
gp_Dir aDirX = gp::DX();
|
||||
Standard_Integer anArgIter = 2; // 1st is an IO name
|
||||
if (anArgIter < theArgsNb)
|
||||
{
|
||||
anOrigin.SetX (Draw::Atof (theArgVec[anArgIter++]));
|
||||
anOrigin.SetY (Draw::Atof (theArgVec[anArgIter++]));
|
||||
anOrigin.SetZ (Draw::Atof (theArgVec[anArgIter++]));
|
||||
if (anArgIter < theArgsNb)
|
||||
{
|
||||
Standard_Real aX = Draw::Atof (theArgVec[anArgIter++]);
|
||||
Standard_Real aY = Draw::Atof (theArgVec[anArgIter++]);
|
||||
Standard_Real aZ = Draw::Atof (theArgVec[anArgIter++]);
|
||||
aDirZ.SetCoord (aX, aY, aZ);
|
||||
|
||||
aX = Draw::Atof (theArgVec[anArgIter++]);
|
||||
aY = Draw::Atof (theArgVec[anArgIter++]);
|
||||
aZ = Draw::Atof (theArgVec[anArgIter++]);
|
||||
aDirX.SetCoord (aX, aY, aZ);
|
||||
}
|
||||
Handle(TColStd_HSequenceOfAsciiString) aValues;
|
||||
|
||||
if (aMapOfArgs.Find ("origin", aValues))
|
||||
{
|
||||
anOrigin.SetX (aValues->Value(1).RealValue());
|
||||
anOrigin.SetY (aValues->Value(2).RealValue());
|
||||
anOrigin.SetZ (aValues->Value(3).RealValue());
|
||||
}
|
||||
|
||||
Handle(TColStd_HSequenceOfAsciiString) aValues2;
|
||||
if (aMapOfArgs.Find ("xaxis", aValues) && aMapOfArgs.Find ("zaxis", aValues2))
|
||||
{
|
||||
Standard_Real aX = aValues->Value(1).RealValue();
|
||||
Standard_Real aY = aValues->Value(2).RealValue();
|
||||
Standard_Real aZ = aValues->Value(3).RealValue();
|
||||
aDirX.SetCoord (aX, aY, aZ);
|
||||
|
||||
aX = aValues->Value(1).RealValue();
|
||||
aY = aValues->Value(2).RealValue();
|
||||
aZ = aValues->Value(3).RealValue();
|
||||
aDirZ.SetCoord (aX, aY, aZ);
|
||||
}
|
||||
|
||||
if (!aDirZ.IsNormal (aDirX, M_PI / 180.0))
|
||||
{
|
||||
theDi << theArgVec[0] << " - VectorX is not normal to VectorZ\n";
|
||||
std::cout << theArgVec[0] << " error - VectorX is not normal to VectorZ\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(Geom_Axis2Placement) aPlacement = new Geom_Axis2Placement (anOrigin, aDirZ, aDirX);
|
||||
Handle(AIS_Trihedron) aShape = new AIS_Trihedron (aPlacement);
|
||||
|
||||
if (aMapOfArgs.Find ("hidelabels", aValues))
|
||||
{
|
||||
const Handle(Prs3d_Drawer)& aDrawer = aShape->Attributes();
|
||||
|
||||
if(!aDrawer->HasOwnDatumAspect())
|
||||
{
|
||||
Handle(Prs3d_DatumAspect) aDefAspect = ViewerTest::GetAISContext()->DefaultDrawer()->DatumAspect();
|
||||
|
||||
Handle(Prs3d_DatumAspect) aDatumAspect = new Prs3d_DatumAspect();
|
||||
aDatumAspect->FirstAxisAspect()->SetAspect (aDefAspect->FirstAxisAspect()->Aspect());
|
||||
aDatumAspect->SecondAxisAspect()->SetAspect (aDefAspect->SecondAxisAspect()->Aspect());
|
||||
aDatumAspect->ThirdAxisAspect()->SetAspect (aDefAspect->ThirdAxisAspect()->Aspect());
|
||||
aDatumAspect->SetAxisLength (aDefAspect->FirstAxisLength(),
|
||||
aDefAspect->SecondAxisLength(),
|
||||
aDefAspect->ThirdAxisLength());
|
||||
|
||||
aDrawer->SetDatumAspect (aDatumAspect);
|
||||
}
|
||||
|
||||
aDrawer->DatumAspect()->SetToDrawLabels (Standard_False);
|
||||
}
|
||||
|
||||
VDisplayAISObject (theArgVec[1], aShape);
|
||||
return 0;
|
||||
}
|
||||
@@ -6223,8 +6304,9 @@ void ViewerTest::ObjectCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
const char *group ="AISObjects";
|
||||
theCommands.Add("vtrihedron",
|
||||
"vtrihedron : vtrihedron name [Xo] [Yo] [Zo] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw] "
|
||||
"\n\t\t: Creates a new *AIS_Trihedron* object. If no argument is set, the default trihedron (0XYZ) is created.",
|
||||
"vtrihedron : vtrihedron name [ -origin x y z ] [ -zaxis u v w -xaxis u v w ] [ -hidelabels ]"
|
||||
"\n\t\t: Creates a new *AIS_Trihedron* object. If no argument is set, the default trihedron (0XYZ) is created."
|
||||
"\n\t\t: -hidelabels allows to draw trihedron without axes labels. By default, they are displayed.",
|
||||
__FILE__,VTrihedron,group);
|
||||
|
||||
theCommands.Add("vtri2d",
|
||||
|
@@ -1986,7 +1986,7 @@ static LRESULT WINAPI ViewerWindowProc( HWND hwnd,
|
||||
case WM_MOVE:
|
||||
case WM_MOVING:
|
||||
case WM_SIZING:
|
||||
switch (aView->RenderingParams().StereoMode)
|
||||
switch (aView->RenderingParams()->StereoMode)
|
||||
{
|
||||
case Graphic3d_StereoMode_RowInterlaced:
|
||||
case Graphic3d_StereoMode_ColumnInterlaced:
|
||||
@@ -5097,9 +5097,9 @@ static int VFps (Draw_Interpretor& theDI,
|
||||
<< "CPU: " << (1000.0 * aCpuAver) << " msec\n";
|
||||
|
||||
// compute additional statistics in ray-tracing mode
|
||||
Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams();
|
||||
Handle(Graphic3d_RenderingParams) aParams = aView->ChangeRenderingParams();
|
||||
|
||||
if (aParams.Method == Graphic3d_RM_RAYTRACING)
|
||||
if (aParams->Method == Graphic3d_RM_RAYTRACING)
|
||||
{
|
||||
Standard_Integer aSizeX;
|
||||
Standard_Integer aSizeY;
|
||||
@@ -5107,7 +5107,7 @@ static int VFps (Draw_Interpretor& theDI,
|
||||
aView->Window()->Size (aSizeX, aSizeY);
|
||||
|
||||
// 1 shadow ray and 1 secondary ray pew each bounce
|
||||
const Standard_Real aMRays = aSizeX * aSizeY * aFpsAver * aParams.RaytracingDepth * 2 / 1.0e6f;
|
||||
const Standard_Real aMRays = aSizeX * aSizeY * aFpsAver * aParams->RaytracingDepth * 2 / 1.0e6f;
|
||||
|
||||
theDI << "MRays/sec (upper bound): " << aMRays << "\n";
|
||||
}
|
||||
@@ -7338,12 +7338,12 @@ static int VStereo (Draw_Interpretor& theDI,
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Camera) aCamera;
|
||||
Graphic3d_RenderingParams* aParams = NULL;
|
||||
Graphic3d_StereoMode aMode = Graphic3d_StereoMode_QuadBuffer;
|
||||
Handle(Graphic3d_Camera) aCamera;
|
||||
Handle(Graphic3d_RenderingParams) aParams = NULL;
|
||||
Graphic3d_StereoMode aMode = Graphic3d_StereoMode_QuadBuffer;
|
||||
if (!aView.IsNull())
|
||||
{
|
||||
aParams = &aView->ChangeRenderingParams();
|
||||
aParams = aView->ChangeRenderingParams();
|
||||
aMode = aParams->StereoMode;
|
||||
aCamera = aView->Camera();
|
||||
}
|
||||
@@ -8118,14 +8118,14 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
return 1;
|
||||
}
|
||||
|
||||
Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams();
|
||||
Handle(Graphic3d_RenderingParams) aParams = aView->ChangeRenderingParams();
|
||||
TCollection_AsciiString aCmdName (theArgVec[0]);
|
||||
aCmdName.LowerCase();
|
||||
if (aCmdName == "vraytrace")
|
||||
{
|
||||
if (theArgNb == 1)
|
||||
{
|
||||
theDI << (aParams.Method == Graphic3d_RM_RAYTRACING ? "on" : "off") << " ";
|
||||
theDI << (aParams->Method == Graphic3d_RM_RAYTRACING ? "on" : "off") << " ";
|
||||
return 0;
|
||||
}
|
||||
else if (theArgNb == 2)
|
||||
@@ -8135,14 +8135,14 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
if (aValue == "on"
|
||||
|| aValue == "1")
|
||||
{
|
||||
aParams.Method = Graphic3d_RM_RAYTRACING;
|
||||
aParams->Method = Graphic3d_RM_RAYTRACING;
|
||||
aView->Redraw();
|
||||
return 0;
|
||||
}
|
||||
else if (aValue == "off"
|
||||
|| aValue == "0")
|
||||
{
|
||||
aParams.Method = Graphic3d_RM_RASTERIZATION;
|
||||
aParams->Method = Graphic3d_RM_RASTERIZATION;
|
||||
aView->Redraw();
|
||||
return 0;
|
||||
}
|
||||
@@ -8162,19 +8162,19 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
if (theArgNb < 2)
|
||||
{
|
||||
theDI << "renderMode: ";
|
||||
switch (aParams.Method)
|
||||
switch (aParams->Method)
|
||||
{
|
||||
case Graphic3d_RM_RASTERIZATION: theDI << "rasterization "; break;
|
||||
case Graphic3d_RM_RAYTRACING: theDI << "raytrace "; break;
|
||||
}
|
||||
theDI << "\n";
|
||||
theDI << "fsaa: " << (aParams.IsAntialiasingEnabled ? "on" : "off") << "\n";
|
||||
theDI << "shadows: " << (aParams.IsShadowEnabled ? "on" : "off") << "\n";
|
||||
theDI << "reflections: " << (aParams.IsReflectionEnabled ? "on" : "off") << "\n";
|
||||
theDI << "rayDepth: " << aParams.RaytracingDepth << "\n";
|
||||
theDI << "gleam: " << (aParams.IsTransparentShadowEnabled ? "on" : "off") << "\n";
|
||||
theDI << "GI: " << (aParams.IsGlobalIlluminationEnabled ? "on" : "off") << "\n";
|
||||
theDI << "blocked RNG: " << (aParams.CoherentPathTracingMode ? "on" : "off") << "\n";
|
||||
theDI << "fsaa: " << (aParams->IsAntialiasingEnabled ? "on" : "off") << "\n";
|
||||
theDI << "shadows: " << (aParams->IsShadowEnabled ? "on" : "off") << "\n";
|
||||
theDI << "reflections: " << (aParams->IsReflectionEnabled ? "on" : "off") << "\n";
|
||||
theDI << "rayDepth: " << aParams->RaytracingDepth << "\n";
|
||||
theDI << "gleam: " << (aParams->IsTransparentShadowEnabled ? "on" : "off") << "\n";
|
||||
theDI << "GI: " << (aParams->IsGlobalIlluminationEnabled ? "on" : "off") << "\n";
|
||||
theDI << "blocked RNG: " << (aParams->CoherentPathTracingMode ? "on" : "off") << "\n";
|
||||
theDI << "shadingModel: ";
|
||||
switch (aView->ShadingModel())
|
||||
{
|
||||
@@ -8210,7 +8210,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
switch (aParams.Method)
|
||||
switch (aParams->Method)
|
||||
{
|
||||
case Graphic3d_RM_RASTERIZATION: theDI << "rasterization "; break;
|
||||
case Graphic3d_RM_RAYTRACING: theDI << "ray-tracing "; break;
|
||||
@@ -8228,11 +8228,11 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.Method == Graphic3d_RM_RAYTRACING ? "true" : "false") << " ";
|
||||
theDI << (aParams->Method == Graphic3d_RM_RAYTRACING ? "true" : "false") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
aParams.Method = Graphic3d_RM_RAYTRACING;
|
||||
aParams->Method = Graphic3d_RM_RAYTRACING;
|
||||
}
|
||||
else if (aFlag == "-rast"
|
||||
|| aFlag == "-raster"
|
||||
@@ -8240,18 +8240,18 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.Method == Graphic3d_RM_RASTERIZATION ? "true" : "false") << " ";
|
||||
theDI << (aParams->Method == Graphic3d_RM_RASTERIZATION ? "true" : "false") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
aParams.Method = Graphic3d_RM_RASTERIZATION;
|
||||
aParams->Method = Graphic3d_RM_RASTERIZATION;
|
||||
}
|
||||
else if (aFlag == "-raydepth"
|
||||
|| aFlag == "-ray_depth")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << aParams.RaytracingDepth << " ";
|
||||
theDI << aParams->RaytracingDepth << " ";
|
||||
continue;
|
||||
}
|
||||
else if (++anArgIter >= theArgNb)
|
||||
@@ -8263,14 +8263,14 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
const Standard_Integer aDepth = Draw::Atoi (theArgVec[anArgIter]);
|
||||
|
||||
// We allow RaytracingDepth be more than 10 in case of GI enabled
|
||||
if (aDepth < 1 || (aDepth > 10 && !aParams.IsGlobalIlluminationEnabled))
|
||||
if (aDepth < 1 || (aDepth > 10 && !aParams->IsGlobalIlluminationEnabled))
|
||||
{
|
||||
std::cerr << "Error: invalid ray-tracing depth " << aDepth << ". Should be within range [1; 10]\n";
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
aParams.RaytracingDepth = aDepth;
|
||||
aParams->RaytracingDepth = aDepth;
|
||||
}
|
||||
}
|
||||
else if (aFlag == "-shad"
|
||||
@@ -8278,7 +8278,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.IsShadowEnabled ? "on" : "off") << " ";
|
||||
theDI << (aParams->IsShadowEnabled ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8288,14 +8288,14 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.IsShadowEnabled = toEnable;
|
||||
aParams->IsShadowEnabled = toEnable;
|
||||
}
|
||||
else if (aFlag == "-refl"
|
||||
|| aFlag == "-reflections")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.IsReflectionEnabled ? "on" : "off") << " ";
|
||||
theDI << (aParams->IsReflectionEnabled ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8305,13 +8305,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.IsReflectionEnabled = toEnable;
|
||||
aParams->IsReflectionEnabled = toEnable;
|
||||
}
|
||||
else if (aFlag == "-fsaa")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.IsAntialiasingEnabled ? "on" : "off") << " ";
|
||||
theDI << (aParams->IsAntialiasingEnabled ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8321,13 +8321,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.IsAntialiasingEnabled = toEnable;
|
||||
aParams->IsAntialiasingEnabled = toEnable;
|
||||
}
|
||||
else if (aFlag == "-gleam")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.IsTransparentShadowEnabled ? "on" : "off") << " ";
|
||||
theDI << (aParams->IsTransparentShadowEnabled ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8337,13 +8337,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.IsTransparentShadowEnabled = toEnable;
|
||||
aParams->IsTransparentShadowEnabled = toEnable;
|
||||
}
|
||||
else if (aFlag == "-gi")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.IsGlobalIlluminationEnabled ? "on" : "off") << " ";
|
||||
theDI << (aParams->IsGlobalIlluminationEnabled ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8353,10 +8353,10 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.IsGlobalIlluminationEnabled = toEnable;
|
||||
aParams->IsGlobalIlluminationEnabled = toEnable;
|
||||
if (!toEnable)
|
||||
{
|
||||
aParams.RaytracingDepth = Min (aParams.RaytracingDepth, 10);
|
||||
aParams->RaytracingDepth = Min (aParams->RaytracingDepth, 10);
|
||||
}
|
||||
}
|
||||
else if (aFlag == "-blockedrng"
|
||||
@@ -8364,7 +8364,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.CoherentPathTracingMode ? "on" : "off") << " ";
|
||||
theDI << (aParams->CoherentPathTracingMode ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8374,13 +8374,13 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.CoherentPathTracingMode = toEnable;
|
||||
aParams->CoherentPathTracingMode = toEnable;
|
||||
}
|
||||
else if (aFlag == "-env")
|
||||
{
|
||||
if (toPrint)
|
||||
{
|
||||
theDI << (aParams.UseEnvironmentMapBackground ? "on" : "off") << " ";
|
||||
theDI << (aParams->UseEnvironmentMapBackground ? "on" : "off") << " ";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8390,7 +8390,7 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
{
|
||||
--anArgIter;
|
||||
}
|
||||
aParams.UseEnvironmentMapBackground = toEnable;
|
||||
aParams->UseEnvironmentMapBackground = toEnable;
|
||||
}
|
||||
else if (aFlag == "-shademodel"
|
||||
|| aFlag == "-shadingmodel"
|
||||
@@ -8444,6 +8444,25 @@ static Standard_Integer VRenderParams (Draw_Interpretor& theDI,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (aFlag == "-resolution")
|
||||
{
|
||||
if (++anArgIter >= theArgNb)
|
||||
{
|
||||
std::cerr << "Error: wrong syntax at argument '" << anArg << "'\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TCollection_AsciiString aResolution (theArgVec[anArgIter]);
|
||||
if (aResolution.IsIntegerValue())
|
||||
{
|
||||
aView->ChangeRenderingParams()->Resolution = static_cast<unsigned int> (Draw::Atoi (aResolution.ToCString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error: wrong syntax at argument'" << anArg << "'.\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error: wrong syntax, unknown flag '" << anArg << "'\n";
|
||||
@@ -9164,6 +9183,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
||||
"\n '-env on|off' Enables/disables environment map background"
|
||||
"\n '-shadingModel model' Controls shading model from enumeration"
|
||||
"\n color, flat, gouraud, phong"
|
||||
"\n '-resolution value' Sets a new pixels density (PPI), defines scaling factor for parameters like text size"
|
||||
"\n Unlike vcaps, these parameters dramatically change visual properties."
|
||||
"\n Command is intended to control presentation quality depending on"
|
||||
"\n hardware capabilities and performance.",
|
||||
|
@@ -9,6 +9,7 @@ XCAFDimTolObjects_Tool.cxx
|
||||
XCAFDimTolObjects_Tool.hxx
|
||||
XCAFDimTolObjects_DatumModifWithValue.hxx
|
||||
XCAFDimTolObjects_DatumSingleModif.hxx
|
||||
XCAFDimTolObjects_DatumTargetType.hxx
|
||||
XCAFDimTolObjects_DimensionModif.hxx
|
||||
XCAFDimTolObjects_DimensionFormVariance.hxx
|
||||
XCAFDimTolObjects_DimensionGrade.hxx
|
||||
|
@@ -21,6 +21,9 @@
|
||||
|
||||
XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject()
|
||||
{
|
||||
myIsDTarget = Standard_False;
|
||||
myHasPlane = Standard_False;
|
||||
myHasPnt = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -35,6 +38,13 @@ XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDi
|
||||
myModifierWithValue = theObj->myModifierWithValue;
|
||||
myValueOfModifier = theObj->myValueOfModifier;
|
||||
myDatumTarget = theObj->myDatumTarget;
|
||||
myIsDTarget = theObj->myIsDTarget;
|
||||
myAxis = theObj->myAxis;
|
||||
myDTargetType = theObj->myDTargetType;
|
||||
myPlane = theObj->myPlane;
|
||||
myPnt= theObj->myPnt;
|
||||
myHasPlane = theObj->myHasPlane;
|
||||
myHasPnt = theObj->myHasPnt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -131,12 +141,185 @@ void XCAFDimTolObjects_DatumObject::SetDatumTarget (const TopoDS_Shape& theShape
|
||||
myDatumTarget = theShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer XCAFDimTolObjects_DatumObject::GetPosition() const
|
||||
{
|
||||
return myPosition;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetPosition(const Standard_Integer thePosition)
|
||||
{
|
||||
myPosition = thePosition;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDatumTarget
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
|
||||
Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
|
||||
{
|
||||
return !myDatumTarget.IsNull();
|
||||
return myIsDTarget;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDatumTarget
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::IsDatumTarget(const Standard_Boolean theIsDT)
|
||||
{
|
||||
myIsDTarget = theIsDT;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDatumTargetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
XCAFDimTolObjects_DatumTargetType XCAFDimTolObjects_DatumObject::GetDatumTargetType() const
|
||||
{
|
||||
return myDTargetType;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDatumTargetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetDatumTargetType(const XCAFDimTolObjects_DatumTargetType theType)
|
||||
{
|
||||
myDTargetType = theType;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDatumTargetAxis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax2 XCAFDimTolObjects_DatumObject::GetDatumTargetAxis() const
|
||||
{
|
||||
return myAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDatumTargetAxis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetDatumTargetAxis(const gp_Ax2& theAxis)
|
||||
{
|
||||
myAxis = theAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDatumTargetLength
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetLength() const
|
||||
{
|
||||
return myLength;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDatumTargetLength
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetDatumTargetLength(const Standard_Real theLength)
|
||||
{
|
||||
myLength = theLength;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDatumTargetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetWidth() const
|
||||
{
|
||||
return myWidth;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDatumTargetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetDatumTargetWidth(const Standard_Real theWidth)
|
||||
{
|
||||
myWidth = theWidth;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax2 XCAFDimTolObjects_DatumObject::GetPlane() const
|
||||
{
|
||||
return myPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetPlane(const gp_Ax2& thePlane)
|
||||
{
|
||||
myPlane = thePlane;
|
||||
myHasPlane = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt XCAFDimTolObjects_DatumObject::GetPoint() const
|
||||
{
|
||||
return myPnt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DatumObject::SetPoint(const gp_Pnt& thePnt)
|
||||
{
|
||||
myPnt = thePnt;
|
||||
myHasPnt = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_DatumObject::HasPlane () const
|
||||
{
|
||||
return myHasPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_DatumObject::HasPoint () const
|
||||
{
|
||||
return myHasPnt;
|
||||
}
|
@@ -21,6 +21,7 @@
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <XCAFDimTolObjects_DatumObjectSequence.hxx>
|
||||
#include <XCAFDimTolObjects_DatumTargetType.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <XCAFDimTolObjects_DatumModifiersSequence.hxx>
|
||||
#include <XCAFDimTolObjects_DatumModifWithValue.hxx>
|
||||
@@ -29,6 +30,7 @@
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <XCAFDimTolObjects_DatumSingleModif.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
|
||||
class XCAFDimTolObjects_DatumObject;
|
||||
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_DatumObject, Standard_Transient)
|
||||
@@ -60,10 +62,43 @@ public:
|
||||
Standard_EXPORT TopoDS_Shape GetDatumTarget() const;
|
||||
|
||||
Standard_EXPORT void SetDatumTarget (const TopoDS_Shape& theShape);
|
||||
|
||||
Standard_EXPORT Standard_Integer GetPosition () const;
|
||||
|
||||
Standard_EXPORT void SetPosition (const Standard_Integer thePosition);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDatumTarget() const;
|
||||
|
||||
Standard_EXPORT void IsDatumTarget(const Standard_Boolean theIsDT);
|
||||
|
||||
Standard_EXPORT XCAFDimTolObjects_DatumTargetType GetDatumTargetType() const;
|
||||
|
||||
Standard_EXPORT void SetDatumTargetType (const XCAFDimTolObjects_DatumTargetType theType);
|
||||
|
||||
Standard_EXPORT gp_Ax2 GetDatumTargetAxis() const;
|
||||
|
||||
Standard_EXPORT void SetDatumTargetAxis (const gp_Ax2& theAxis);
|
||||
|
||||
Standard_EXPORT Standard_Real GetDatumTargetLength() const;
|
||||
|
||||
Standard_EXPORT void SetDatumTargetLength (const Standard_Real theLength);
|
||||
|
||||
Standard_EXPORT Standard_Real GetDatumTargetWidth() const;
|
||||
|
||||
Standard_EXPORT void SetDatumTargetWidth (const Standard_Real theWidth);
|
||||
|
||||
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane);
|
||||
|
||||
Standard_EXPORT gp_Ax2 GetPlane () const;
|
||||
|
||||
Standard_EXPORT void SetPoint (const gp_Pnt& thePnt);
|
||||
|
||||
Standard_EXPORT gp_Pnt GetPoint () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPlane () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPoint () const;
|
||||
|
||||
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_DatumObject,Standard_Transient)
|
||||
|
||||
private:
|
||||
@@ -73,6 +108,16 @@ private:
|
||||
XCAFDimTolObjects_DatumModifWithValue myModifierWithValue;
|
||||
Standard_Real myValueOfModifier;
|
||||
TopoDS_Shape myDatumTarget;
|
||||
Standard_Integer myPosition;
|
||||
Standard_Boolean myIsDTarget;
|
||||
XCAFDimTolObjects_DatumTargetType myDTargetType;
|
||||
gp_Ax2 myAxis;
|
||||
Standard_Real myLength;
|
||||
Standard_Real myWidth;
|
||||
gp_Ax2 myPlane;
|
||||
gp_Pnt myPnt;
|
||||
Standard_Boolean myHasPlane;
|
||||
Standard_Boolean myHasPnt;
|
||||
|
||||
};
|
||||
|
||||
|
30
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumTargetType.hxx
Normal file
30
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumTargetType.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created on: 2015-08-06
|
||||
// Created by: Ilya Novikov
|
||||
// Copyright (c) 2004-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#ifndef _XCAFDimTolObjects_DatumTargetType_HeaderFile
|
||||
#define _XCAFDimTolObjects_DatumTargetType_HeaderFile
|
||||
|
||||
//! Defines types of dimension
|
||||
enum XCAFDimTolObjects_DatumTargetType
|
||||
{
|
||||
XCAFDimTolObjects_DatumTargetType_Point,
|
||||
XCAFDimTolObjects_DatumTargetType_Line,
|
||||
XCAFDimTolObjects_DatumTargetType_Rectangle,
|
||||
XCAFDimTolObjects_DatumTargetType_Circle,
|
||||
XCAFDimTolObjects_DatumTargetType_Area
|
||||
};
|
||||
|
||||
#endif // _XCAFDimTolObjects_DatumTargetType_HeaderFile
|
@@ -24,6 +24,7 @@
|
||||
|
||||
XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject()
|
||||
{
|
||||
myHasPlane = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -45,6 +46,8 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handl
|
||||
myPath = theObj->myPath;
|
||||
myDir = theObj->myDir;
|
||||
myPnts = theObj->myPnts;
|
||||
myHasPlane = theObj->myHasPlane;
|
||||
myPlane = theObj->myPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -313,10 +316,10 @@ Standard_Boolean XCAFDimTolObjects_DimensionObject::GetClassOfTolerance (Standar
|
||||
XCAFDimTolObjects_DimensionFormVariance& theFormVariance,
|
||||
XCAFDimTolObjects_DimensionGrade& theGrade) const
|
||||
{
|
||||
theFormVariance = myFormVariance;
|
||||
if(myFormVariance != XCAFDimTolObjects_DimensionFormVariance_None)
|
||||
{
|
||||
theHole = myIsHole;
|
||||
theFormVariance = myFormVariance;
|
||||
theGrade = myGrade;
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -428,3 +431,44 @@ void XCAFDimTolObjects_DimensionObject::SetPoints (const Handle(TColgp_HArray1Of
|
||||
{
|
||||
myPnts = thePnts;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax2 XCAFDimTolObjects_DimensionObject::GetPlane() const
|
||||
{
|
||||
return myPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_DimensionObject::SetPlane(const gp_Ax2& thePlane)
|
||||
{
|
||||
myPlane = thePlane;
|
||||
myHasPlane = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_DimensionObject::HasPlane () const
|
||||
{
|
||||
return myHasPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_DimensionObject::HasPoints () const
|
||||
{
|
||||
return myPnts->Length() > 0;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
@@ -116,6 +117,13 @@ public:
|
||||
|
||||
Standard_EXPORT void SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts);
|
||||
|
||||
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane);
|
||||
|
||||
Standard_EXPORT gp_Ax2 GetPlane () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPlane () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPoints () const;
|
||||
|
||||
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_DimensionObject,Standard_Transient)
|
||||
|
||||
@@ -133,6 +141,8 @@ private:
|
||||
TopoDS_Edge myPath;
|
||||
gp_Dir myDir;
|
||||
Handle(TColgp_HArray1OfPnt) myPnts;
|
||||
gp_Ax2 myPlane;
|
||||
Standard_Boolean myHasPlane;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -33,7 +33,9 @@ XCAFDimTolObjects_GeomToleranceModif_Pitch_Diameter,
|
||||
XCAFDimTolObjects_GeomToleranceModif_Reciprocity_Requirement,
|
||||
XCAFDimTolObjects_GeomToleranceModif_Separate_Requirement,
|
||||
XCAFDimTolObjects_GeomToleranceModif_Statistical_Tolerance,
|
||||
XCAFDimTolObjects_GeomToleranceModif_Tangent_Plane
|
||||
XCAFDimTolObjects_GeomToleranceModif_Tangent_Plane,
|
||||
XCAFDimTolObjects_GeomToleranceModif_All_Around,
|
||||
XCAFDimTolObjects_GeomToleranceModif_All_Over,
|
||||
};
|
||||
|
||||
#endif // _XCAFDimTolObjects_GeomToleranceModif_HeaderFile
|
||||
|
@@ -20,6 +20,9 @@
|
||||
|
||||
XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject()
|
||||
{
|
||||
myHasAxis = Standard_False;
|
||||
myHasPlane = Standard_False;
|
||||
myHasPnt = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -37,6 +40,12 @@ XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(con
|
||||
myValueOfZoneModif = theObj->myValueOfZoneModif;
|
||||
myModifiers = theObj->myModifiers;
|
||||
myMaxValueModif = theObj->myMaxValueModif;
|
||||
myAxis = theObj->myAxis;
|
||||
myPlane = theObj->myPlane;
|
||||
myPnt= theObj->myPnt;
|
||||
myHasAxis = theObj->myHasAxis;
|
||||
myHasPlane = theObj->myHasPlane;
|
||||
myHasPnt = theObj->myHasPnt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -208,3 +217,96 @@ Standard_Real XCAFDimTolObjects_GeomToleranceObject::GetMaxValueModifier() cons
|
||||
{
|
||||
return myMaxValueModif;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_GeomToleranceObject::SetAxis (const gp_Ax2 theAxis)
|
||||
{
|
||||
myAxis = theAxis;
|
||||
myHasAxis = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax2 XCAFDimTolObjects_GeomToleranceObject::GetAxis() const
|
||||
{
|
||||
return myAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasAxis () const
|
||||
{
|
||||
return myHasAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax2 XCAFDimTolObjects_GeomToleranceObject::GetPlane() const
|
||||
{
|
||||
return myPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_GeomToleranceObject::SetPlane(const gp_Ax2& thePlane)
|
||||
{
|
||||
myPlane = thePlane;
|
||||
myHasPlane = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt XCAFDimTolObjects_GeomToleranceObject::GetPoint() const
|
||||
{
|
||||
return myPnt;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDimTolObjects_GeomToleranceObject::SetPoint(const gp_Pnt& thePnt)
|
||||
{
|
||||
myPnt = thePnt;
|
||||
myHasPlane = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasPlane () const
|
||||
{
|
||||
return myHasPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasPoint () const
|
||||
{
|
||||
return myHasPnt;
|
||||
}
|
@@ -29,6 +29,7 @@
|
||||
#include <XCAFDimTolObjects_GeomToleranceModifiersSequence.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <XCAFDimTolObjects_GeomToleranceModif.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
|
||||
class XCAFDimTolObjects_GeomToleranceObject;
|
||||
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_GeomToleranceObject, Standard_Transient)
|
||||
@@ -77,6 +78,24 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_Real GetMaxValueModifier() const;
|
||||
|
||||
Standard_EXPORT void SetAxis (const gp_Ax2 theAxis);
|
||||
|
||||
Standard_EXPORT gp_Ax2 GetAxis() const;
|
||||
|
||||
Standard_EXPORT void SetPlane(const gp_Ax2& thePlane);
|
||||
|
||||
Standard_EXPORT gp_Ax2 GetPlane() const;
|
||||
|
||||
Standard_EXPORT void SetPoint (const gp_Pnt& thePnt);
|
||||
|
||||
Standard_EXPORT gp_Pnt GetPoint () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasAxis () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPlane () const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPoint () const;
|
||||
|
||||
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
|
||||
|
||||
private:
|
||||
@@ -89,7 +108,12 @@ private:
|
||||
Standard_Real myValueOfZoneModif;
|
||||
XCAFDimTolObjects_GeomToleranceModifiersSequence myModifiers;
|
||||
Standard_Real myMaxValueModif;
|
||||
|
||||
gp_Ax2 myAxis;
|
||||
Standard_Boolean myHasAxis;
|
||||
gp_Ax2 myPlane;
|
||||
gp_Pnt myPnt;
|
||||
Standard_Boolean myHasPlane;
|
||||
Standard_Boolean myHasPnt;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -173,11 +173,11 @@ Standard_Boolean XCAFDimTolObjects_Tool::GetRefDatum(const TopoDS_Shape& theShap
|
||||
myDimTolTool->ShapeTool()->Search(theShape, aShapeL);
|
||||
if(!aShapeL.IsNull())
|
||||
{
|
||||
TDF_Label aDatumL;
|
||||
TDF_LabelSequence aDatumL;
|
||||
if(myDimTolTool->GetRefDatumLabel(aShapeL, aDatumL))
|
||||
{
|
||||
Handle(XCAFDoc_Datum) aDatum;
|
||||
if( aDatumL.FindAttribute(XCAFDoc_Datum::GetID(),aDatum)){
|
||||
if( aDatumL.First().FindAttribute(XCAFDoc_Datum::GetID(),aDatum)){
|
||||
theDatumObject = aDatum->GetObject();
|
||||
return Standard_True;
|
||||
}
|
||||
|
@@ -94,12 +94,23 @@ Standard_GUID XCAFDoc::DimTolRefGUID()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_GUID XCAFDoc::DimensionRefGUID()
|
||||
Standard_GUID XCAFDoc::DimensionRefFirstGUID()
|
||||
{
|
||||
static Standard_GUID ID("efd212e3-6dfd-11d4-b9c8-0060b0ee281b");
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DimensionRefGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_GUID XCAFDoc::DimensionRefSecondGUID()
|
||||
{
|
||||
static Standard_GUID ID("efd212e0-6dfd-11d4-b9c8-0060b0ee281b");
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomToleranceRefGUID
|
||||
//purpose :
|
||||
|
@@ -77,7 +77,10 @@ public:
|
||||
Standard_EXPORT static Standard_GUID DimTolRefGUID();
|
||||
|
||||
//! Return GUIDs for TreeNode representing specified types of Dimension
|
||||
Standard_EXPORT static Standard_GUID DimensionRefGUID() ;
|
||||
Standard_EXPORT static Standard_GUID DimensionRefFirstGUID() ;
|
||||
|
||||
//! Return GUIDs for TreeNode representing specified types of Dimension
|
||||
Standard_EXPORT static Standard_GUID DimensionRefSecondGUID() ;
|
||||
|
||||
//! Return GUIDs for TreeNode representing specified types of GeomTolerance
|
||||
Standard_EXPORT static Standard_GUID GeomToleranceRefGUID() ;
|
||||
|
@@ -17,10 +17,12 @@
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <XCAFDoc_Datum.hxx>
|
||||
#include <TDataStd_AsciiString.hxx>
|
||||
#include <TDataStd_IntegerArray.hxx>
|
||||
#include <TDataStd_RealArray.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
@@ -34,7 +36,18 @@ enum ChildLab
|
||||
ChildLab_Name = 1,
|
||||
ChildLab_Modifiers,
|
||||
ChildLab_ModifierWithValue,
|
||||
ChildLab_DatumTarget
|
||||
ChildLab_IsDTarget,
|
||||
ChildLab_DTargetType,
|
||||
ChildLab_AxisLoc,
|
||||
ChildLab_AxisN,
|
||||
ChildLab_AxisRef,
|
||||
ChildLab_DTargetLength,
|
||||
ChildLab_DTargetWidth,
|
||||
ChildLab_DatumTarget,
|
||||
ChildLab_PlaneLoc,
|
||||
ChildLab_PlaneN,
|
||||
ChildLab_PlaneRef,
|
||||
ChildLab_Pnt,
|
||||
};
|
||||
|
||||
//=======================================================================
|
||||
@@ -152,7 +165,12 @@ Handle(TCollection_HAsciiString) XCAFDoc_Datum::GetIdentification() const
|
||||
void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theObject)
|
||||
{
|
||||
Backup();
|
||||
if (!theObject->GetName().IsNull())
|
||||
TDF_ChildIterator anIter(Label());
|
||||
for(;anIter.More(); anIter.Next())
|
||||
{
|
||||
anIter.Value().ForgetAllAttributes();
|
||||
}
|
||||
if (!theObject->GetName().IsNull() && !theObject->GetName()->IsEmpty())
|
||||
{
|
||||
Handle(TDataStd_AsciiString) anAttName;
|
||||
if(!Label().FindChild(ChildLab_Name).FindAttribute(TDataStd_AsciiString::GetID(), anAttName))
|
||||
@@ -162,16 +180,8 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
|
||||
}
|
||||
anAttName->Set(theObject->GetName()->String());
|
||||
}
|
||||
else
|
||||
{
|
||||
Label().FindChild(ChildLab_Name).ForgetAllAttributes();
|
||||
}
|
||||
|
||||
if(theObject->GetModifiers().Length() == 0)
|
||||
{
|
||||
Label().FindChild(ChildLab_Modifiers).ForgetAllAttributes();
|
||||
}
|
||||
else
|
||||
if(theObject->GetModifiers().Length() > 0)
|
||||
{
|
||||
Handle(TDataStd_IntegerArray) aModifiers;
|
||||
if(!Label().FindChild(ChildLab_Modifiers).FindAttribute(TDataStd_IntegerArray::GetID(), aModifiers))
|
||||
@@ -205,19 +215,97 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
|
||||
aModifierWithValueM->Set(aM);
|
||||
aModifierWithValueV->Set(aV);
|
||||
}
|
||||
else
|
||||
|
||||
Handle(TDataStd_Integer) aIsTarget = new TDataStd_Integer();
|
||||
aIsTarget->Set(theObject->IsDatumTarget());
|
||||
Label().FindChild(ChildLab_IsDTarget).AddAttribute(aIsTarget);
|
||||
|
||||
if(theObject->IsDatumTarget())
|
||||
{
|
||||
Label().FindChild(ChildLab_ModifierWithValue).ForgetAllAttributes();
|
||||
Handle(TDataStd_Integer) aType = new TDataStd_Integer();
|
||||
aType->Set(theObject->GetDatumTargetType());
|
||||
Label().FindChild(ChildLab_DTargetType).AddAttribute(aType);
|
||||
|
||||
if(theObject->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Area)
|
||||
{
|
||||
if(!theObject->GetDatumTarget().IsNull())
|
||||
{
|
||||
TNaming_Builder tnBuild(Label().FindChild(ChildLab_DatumTarget));
|
||||
tnBuild.Generated(theObject->GetDatumTarget());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
|
||||
gp_Ax2 anAx = theObject->GetDatumTargetAxis();
|
||||
aLoc->SetValue(aLoc->Upper(),anAx.Location().X());
|
||||
aLoc->SetValue(aLoc->Upper()+1,anAx.Location().Y());
|
||||
aLoc->SetValue(aLoc->Upper()+2,anAx.Location().Z());
|
||||
|
||||
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
|
||||
aN->SetValue(aN->Upper()+1,anAx.Axis().Direction().Y());
|
||||
aN->SetValue(aN->Upper()+2,anAx.Axis().Direction().Z());
|
||||
|
||||
aR->SetValue(aR->Upper(),anAx.Direction().X());
|
||||
aR->SetValue(aR->Upper()+1,anAx.Direction().Y());
|
||||
aR->SetValue(aR->Upper()+2,anAx.Direction().Z());
|
||||
|
||||
Label().FindChild(ChildLab_AxisLoc).AddAttribute(aLoc);
|
||||
Label().FindChild(ChildLab_AxisN).AddAttribute(aN);
|
||||
Label().FindChild(ChildLab_AxisRef).AddAttribute(aR);
|
||||
|
||||
if(theObject->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
|
||||
{
|
||||
Handle(TDataStd_Real) aLen = new TDataStd_Real();
|
||||
aLen->Set(theObject->GetDatumTargetLength());
|
||||
Label().FindChild(ChildLab_DTargetLength).AddAttribute(aLen);
|
||||
if(theObject->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
|
||||
{
|
||||
Handle(TDataStd_Real) aWidth = new TDataStd_Real();
|
||||
aWidth->Set(theObject->GetDatumTargetWidth());
|
||||
Label().FindChild(ChildLab_DTargetWidth).AddAttribute(aWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!theObject->GetDatumTarget().IsNull())
|
||||
if (theObject->HasPlane())
|
||||
{
|
||||
TNaming_Builder tnBuild(Label().FindChild(ChildLab_DatumTarget));
|
||||
tnBuild.Generated(theObject->GetDatumTarget());
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
|
||||
gp_Ax2 aPln = theObject->GetPlane();
|
||||
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aLocArr->SetValue(i, aPln.Location().Coord(i));
|
||||
aLoc->ChangeArray(aLocArr);
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aNArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aNArr->SetValue(i, aPln.Direction().Coord(i));
|
||||
aN->ChangeArray(aNArr);
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aRArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aRArr->SetValue(i, aPln.XDirection().Coord(i));
|
||||
aR->ChangeArray(aRArr);
|
||||
|
||||
Label().FindChild(ChildLab_PlaneLoc).AddAttribute(aLoc);
|
||||
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
|
||||
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
|
||||
}
|
||||
else
|
||||
|
||||
if (theObject->HasPoint())
|
||||
{
|
||||
Label().FindChild(ChildLab_DatumTarget).ForgetAllAttributes();
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
gp_Pnt aPnt = theObject->GetPoint();
|
||||
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aLocArr->SetValue(i, aPnt.Coord(i));
|
||||
aLoc->ChangeArray(aLocArr);
|
||||
Label().FindChild(ChildLab_Pnt).AddAttribute(aLoc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,12 +345,86 @@ Handle(XCAFDimTolObjects_DatumObject) XCAFDoc_Datum::GetObject() const
|
||||
}
|
||||
}
|
||||
|
||||
Handle(TNaming_NamedShape) aDatumTarget;
|
||||
if(Label().FindChild(ChildLab_DatumTarget).FindAttribute(TNaming_NamedShape::GetID(), aDatumTarget))
|
||||
Handle(TDataStd_RealArray) aLoc;
|
||||
Handle(TDataStd_RealArray) aN;
|
||||
Handle(TDataStd_RealArray) aR;
|
||||
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_PlaneN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_PlaneRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
|
||||
{
|
||||
anObj->SetDatumTarget(aDatumTarget->Get());
|
||||
gp_Pnt aL(aLoc->Value(aLoc->Lower()), aLoc->Value(aLoc->Lower()+1), aLoc->Value(aLoc->Lower()+2));
|
||||
gp_Dir aD(aN->Value(aN->Lower()), aN->Value(aN->Lower()+1), aN->Value(aN->Lower()+2));
|
||||
gp_Dir aDR(aR->Value(aR->Lower()), aR->Value(aR->Lower()+1), aR->Value(aR->Lower()+2));
|
||||
gp_Ax2 anAx(aL, aD, aDR);
|
||||
anObj->SetPlane(anAx);
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aPnt;
|
||||
if(Label().FindChild(ChildLab_Pnt).FindAttribute(TDataStd_RealArray::GetID(), aPnt) && aPnt->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aP(aLoc->Value(aPnt->Lower()), aPnt->Value(aPnt->Lower()+1), aPnt->Value(aPnt->Lower()+2));
|
||||
anObj->SetPoint(aP);
|
||||
}
|
||||
|
||||
Handle(TDataStd_Integer) aIsDTarget;
|
||||
if(Label().FindChild(ChildLab_IsDTarget).FindAttribute(TDataStd_Integer::GetID(), aIsDTarget))
|
||||
{
|
||||
anObj->IsDatumTarget((aIsDTarget->Get() != 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
return anObj;
|
||||
}
|
||||
|
||||
if (aIsDTarget->Get() != 0)
|
||||
{
|
||||
Handle(TDataStd_Integer) aDTargetType;
|
||||
if(Label().FindChild(ChildLab_DTargetType).FindAttribute(TDataStd_Integer::GetID(), aDTargetType))
|
||||
{
|
||||
anObj->SetDatumTargetType((XCAFDimTolObjects_DatumTargetType)aDTargetType->Get());
|
||||
if(anObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Area)
|
||||
{
|
||||
Handle(TNaming_NamedShape) aDatumTarget;
|
||||
if(Label().FindChild(ChildLab_DatumTarget).FindAttribute(TNaming_NamedShape::GetID(), aDatumTarget))
|
||||
{
|
||||
anObj->SetDatumTarget(aDatumTarget->Get());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(TDataStd_RealArray) aLoc;
|
||||
Handle(TDataStd_RealArray) aN;
|
||||
Handle(TDataStd_RealArray) aR;
|
||||
if(Label().FindChild(ChildLab_AxisLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_AxisN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_AxisRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aL(aLoc->Value(aLoc->Upper()), aLoc->Value(aLoc->Upper()+1), aLoc->Value(aLoc->Upper()+2));
|
||||
gp_Dir aD(aN->Value(aN->Upper()), aN->Value(aN->Upper()+1), aN->Value(aN->Upper()+2));
|
||||
gp_Dir aDR(aR->Value(aR->Upper()), aR->Value(aR->Upper()+1), aR->Value(aR->Upper()+2));
|
||||
gp_Ax2 anAx(aL, aD, aDR);
|
||||
anObj->SetDatumTargetAxis(anAx);
|
||||
}
|
||||
|
||||
if(anObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
|
||||
{
|
||||
Handle(TDataStd_Real) aLen;
|
||||
if(Label().FindChild(ChildLab_DTargetLength).FindAttribute(TDataStd_Integer::GetID(), aLen))
|
||||
{
|
||||
anObj->SetDatumTargetLength(aLen->Get());
|
||||
}
|
||||
if(anObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
|
||||
{
|
||||
Handle(TDataStd_Real) aWidth;
|
||||
if(Label().FindChild(ChildLab_DTargetWidth).FindAttribute(TDataStd_Integer::GetID(), aWidth))
|
||||
{
|
||||
anObj->SetDatumTargetWidth(aWidth->Get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return anObj;
|
||||
}
|
||||
|
||||
|
@@ -314,43 +314,79 @@ void XCAFDoc_DimTolTool::SetDimension(const TDF_Label& theFirstL,
|
||||
const TDF_Label& theSecondL,
|
||||
const TDF_Label& theDimTolL) const
|
||||
{
|
||||
Handle(XCAFDoc_GraphNode) aChGNode;
|
||||
Handle(XCAFDoc_GraphNode) aFGNode;
|
||||
Handle(XCAFDoc_GraphNode) aSecondFGNode;
|
||||
TDF_LabelSequence aFirstLS, aSecondLS;
|
||||
if(!theFirstL.IsNull())
|
||||
aFirstLS.Append(theFirstL);
|
||||
if(!theSecondL.IsNull())
|
||||
aSecondLS.Append(theSecondL);
|
||||
SetDimension(aFirstLS, aSecondLS, theDimTolL);
|
||||
}
|
||||
|
||||
//Handle(XCAFDoc_GraphNode) ChGNode, FGNode;
|
||||
if ( theDimTolL.FindAttribute (XCAFDoc::DimensionRefGUID(), aChGNode) ) {
|
||||
while (aChGNode->NbFathers() > 0) {
|
||||
aFGNode = aChGNode->GetFather(1);
|
||||
aFGNode->UnSetChild(aChGNode);
|
||||
}
|
||||
theDimTolL.ForgetAttribute ( XCAFDoc::DimTolRefGUID() );
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetDimension
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
if(!IsDimension(theDimTolL))
|
||||
void XCAFDoc_DimTolTool::SetDimension(const TDF_LabelSequence& theFirstL,
|
||||
const TDF_LabelSequence& theSecondL,
|
||||
const TDF_Label& theDimTolL) const
|
||||
{
|
||||
if(!IsDimension(theDimTolL) || theFirstL.Length() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!theDimTolL.FindAttribute(XCAFDoc::DimensionRefGUID(), aChGNode) ) {
|
||||
Handle(XCAFDoc_GraphNode) aChGNode;
|
||||
Handle(XCAFDoc_GraphNode) aFGNode;
|
||||
Handle(XCAFDoc_GraphNode) aSecondFGNode;
|
||||
|
||||
if ( theDimTolL.FindAttribute (XCAFDoc::DimensionRefFirstGUID(), aChGNode) ) {
|
||||
while (aChGNode->NbFathers() > 0) {
|
||||
aFGNode = aChGNode->GetFather(1);
|
||||
aFGNode->UnSetChild(aChGNode);
|
||||
if(aFGNode->NbChildren() == 0)
|
||||
aFGNode->ForgetAttribute( XCAFDoc::DimensionRefFirstGUID() );
|
||||
}
|
||||
theDimTolL.ForgetAttribute ( XCAFDoc::DimensionRefFirstGUID() );
|
||||
}
|
||||
if ( theDimTolL.FindAttribute (XCAFDoc::DimensionRefSecondGUID(), aChGNode) ) {
|
||||
while (aChGNode->NbFathers() > 0) {
|
||||
aFGNode = aChGNode->GetFather(1);
|
||||
aFGNode->UnSetChild(aChGNode);
|
||||
if(aFGNode->NbChildren() == 0)
|
||||
aFGNode->ForgetAttribute( XCAFDoc::DimensionRefSecondGUID() );
|
||||
}
|
||||
theDimTolL.ForgetAttribute ( XCAFDoc::DimensionRefSecondGUID() );
|
||||
}
|
||||
|
||||
if (!theDimTolL.FindAttribute(XCAFDoc::DimensionRefFirstGUID(), aChGNode)) {
|
||||
aChGNode = new XCAFDoc_GraphNode;
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
|
||||
aChGNode->SetGraphID(XCAFDoc::DimensionRefFirstGUID());
|
||||
}
|
||||
if (!theFirstL.FindAttribute(XCAFDoc::DimensionRefGUID(), aFGNode) ) {
|
||||
aFGNode = new XCAFDoc_GraphNode;
|
||||
aFGNode = XCAFDoc_GraphNode::Set(theFirstL);
|
||||
}
|
||||
aFGNode->SetGraphID(XCAFDoc::DimensionRefGUID());
|
||||
aChGNode->SetGraphID(XCAFDoc::DimensionRefGUID());
|
||||
aFGNode->SetChild(aChGNode);
|
||||
aChGNode->SetFather(aFGNode);
|
||||
|
||||
if (!theSecondL.IsNull()){
|
||||
if(!theSecondL.FindAttribute(XCAFDoc::DimensionRefGUID(), aSecondFGNode) ) {
|
||||
aSecondFGNode = new XCAFDoc_GraphNode;
|
||||
aSecondFGNode = XCAFDoc_GraphNode::Set(theSecondL);
|
||||
for(Standard_Integer i = theFirstL.Lower(); i <= theFirstL.Upper(); i++)
|
||||
{
|
||||
if (!theFirstL.Value(i).FindAttribute(XCAFDoc::DimensionRefFirstGUID(), aFGNode) ) {
|
||||
aFGNode = new XCAFDoc_GraphNode;
|
||||
aFGNode = XCAFDoc_GraphNode::Set(theFirstL.Value(i));
|
||||
}
|
||||
aSecondFGNode->SetGraphID(XCAFDoc::DimensionRefGUID());
|
||||
aFGNode->SetGraphID(XCAFDoc::DimensionRefFirstGUID());
|
||||
aFGNode->SetChild(aChGNode);
|
||||
aChGNode->SetFather(aFGNode);
|
||||
}
|
||||
|
||||
if (!theDimTolL.FindAttribute(XCAFDoc::DimensionRefSecondGUID(), aChGNode) && theSecondL.Length() > 0) {
|
||||
aChGNode = new XCAFDoc_GraphNode;
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
|
||||
aChGNode->SetGraphID(XCAFDoc::DimensionRefSecondGUID());
|
||||
}
|
||||
for(Standard_Integer i = theSecondL.Lower(); i <= theSecondL.Upper(); i++)
|
||||
{
|
||||
if(!theSecondL.Value(i).FindAttribute(XCAFDoc::DimensionRefSecondGUID(), aSecondFGNode) ) {
|
||||
aSecondFGNode = new XCAFDoc_GraphNode;
|
||||
aSecondFGNode = XCAFDoc_GraphNode::Set(theSecondL.Value(i));
|
||||
}
|
||||
aSecondFGNode->SetGraphID(XCAFDoc::DimensionRefSecondGUID());
|
||||
aSecondFGNode->SetChild(aChGNode);
|
||||
aChGNode->SetFather(aSecondFGNode);
|
||||
}
|
||||
@@ -364,12 +400,60 @@ void XCAFDoc_DimTolTool::SetDimension(const TDF_Label& theFirstL,
|
||||
void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_Label& theL,
|
||||
const TDF_Label& theDimTolL) const
|
||||
{
|
||||
// set reference
|
||||
Handle(TDataStd_TreeNode) refNode, mainNode;
|
||||
refNode = TDataStd_TreeNode::Set ( theDimTolL, XCAFDoc::GeomToleranceRefGUID() );
|
||||
mainNode = TDataStd_TreeNode::Set ( theL, XCAFDoc::GeomToleranceRefGUID() );
|
||||
refNode->Remove(); // abv: fix against bug in TreeNode::Append()
|
||||
mainNode->Append(refNode);
|
||||
TDF_LabelSequence aSeq;
|
||||
aSeq.Append(theL);
|
||||
SetGeomTolerance(aSeq, theDimTolL);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetGeomTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_LabelSequence& theL,
|
||||
const TDF_Label& theDimTolL) const
|
||||
{
|
||||
// // set reference
|
||||
// Handle(TDataStd_TreeNode) refNode, mainNode;
|
||||
// refNode = TDataStd_TreeNode::Set ( theDimTolL, XCAFDoc::GeomToleranceRefGUID() );
|
||||
// mainNode = TDataStd_TreeNode::Set ( theL, XCAFDoc::GeomToleranceRefGUID() );
|
||||
// refNode->Remove(); // abv: fix against bug in TreeNode::Append()
|
||||
// mainNode->Append(refNode);
|
||||
|
||||
if(!IsGeomTolerance(theDimTolL) || theL.Length() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(XCAFDoc_GraphNode) aChGNode;
|
||||
Handle(XCAFDoc_GraphNode) aFGNode;
|
||||
|
||||
//Handle(XCAFDoc_GraphNode) ChGNode, FGNode;
|
||||
if ( theDimTolL.FindAttribute (XCAFDoc::GeomToleranceRefGUID(), aChGNode) ) {
|
||||
while (aChGNode->NbFathers() > 0) {
|
||||
aFGNode = aChGNode->GetFather(1);
|
||||
aFGNode->UnSetChild(aChGNode);
|
||||
if(aFGNode->NbChildren() == 0)
|
||||
aFGNode->ForgetAttribute( XCAFDoc::GeomToleranceRefGUID() );
|
||||
}
|
||||
theDimTolL.ForgetAttribute ( XCAFDoc::GeomToleranceRefGUID() );
|
||||
}
|
||||
|
||||
if (!theDimTolL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aChGNode)) {
|
||||
aChGNode = new XCAFDoc_GraphNode;
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
|
||||
aChGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID());
|
||||
}
|
||||
for(Standard_Integer i = theL.Lower(); i <= theL.Upper(); i++)
|
||||
{
|
||||
if (!theL.Value(i).FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aFGNode) ) {
|
||||
aFGNode = new XCAFDoc_GraphNode;
|
||||
aFGNode = XCAFDoc_GraphNode::Set(theL.Value(i));
|
||||
}
|
||||
aFGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID());
|
||||
aFGNode->SetChild(aChGNode);
|
||||
aChGNode->SetFather(aFGNode);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -412,26 +496,43 @@ TDF_Label XCAFDoc_DimTolTool::SetDimTol(const TDF_Label& L,
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDoc_DimTolTool::GetRefShapeLabel(const TDF_Label& theL,
|
||||
TDF_LabelSequence& theShapeL) const
|
||||
TDF_LabelSequence& theShapeLFirst,
|
||||
TDF_LabelSequence& theShapeLSecond) const
|
||||
{
|
||||
theShapeL.Clear();
|
||||
theShapeLFirst.Clear();
|
||||
theShapeLSecond.Clear();
|
||||
Handle(TDataStd_TreeNode) aNode;
|
||||
if( !theL.FindAttribute(XCAFDoc::DimTolRefGUID(),aNode) || !aNode->HasFather() ) {
|
||||
if( !theL.FindAttribute(XCAFDoc::DatumRefGUID(),aNode) || !aNode->HasFather() ) {
|
||||
if( !theL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aNode) || !aNode->HasFather() ) {
|
||||
Handle(XCAFDoc_GraphNode) aGNode;
|
||||
if( theL.FindAttribute(XCAFDoc::DimensionRefGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
|
||||
Handle(XCAFDoc_GraphNode) aGNode;
|
||||
if( theL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
|
||||
for(Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
|
||||
{
|
||||
theShapeLFirst.Append(aGNode->GetFather(i)->Label());
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
else if( theL.FindAttribute(XCAFDoc::DimensionRefFirstGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
|
||||
for(Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
|
||||
{
|
||||
theShapeLFirst.Append(aGNode->GetFather(i)->Label());
|
||||
}
|
||||
if( theL.FindAttribute(XCAFDoc::DimensionRefSecondGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
|
||||
for(Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
|
||||
{
|
||||
theShapeL.Append(aGNode->GetFather(i)->Label());
|
||||
theShapeLSecond.Append(aGNode->GetFather(i)->Label());
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
}
|
||||
theShapeL.Append(aNode->Father()->Label());
|
||||
|
||||
theShapeLFirst.Append(aNode->Father()->Label());
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -444,14 +545,22 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefDimensionLabels(const TDF_Label& theS
|
||||
TDF_LabelSequence& theDimTols) const
|
||||
{
|
||||
Handle(XCAFDoc_GraphNode) aGNode;
|
||||
if( theShapeL.FindAttribute(XCAFDoc::DimensionRefGUID(),aGNode) && aGNode->NbChildren() > 0 ) {
|
||||
Standard_Boolean aResult = Standard_False;
|
||||
if( theShapeL.FindAttribute(XCAFDoc::DimensionRefFirstGUID(),aGNode) && aGNode->NbChildren() > 0 ) {
|
||||
for(Standard_Integer i = 1; i <= aGNode->NbChildren(); i++)
|
||||
{
|
||||
theDimTols.Append(aGNode->GetChild(i)->Label());
|
||||
}
|
||||
return Standard_True;
|
||||
aResult = Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
if( theShapeL.FindAttribute(XCAFDoc::DimensionRefSecondGUID(),aGNode) && aGNode->NbChildren() > 0 ) {
|
||||
for(Standard_Integer i = 1; i <= aGNode->NbChildren(); i++)
|
||||
{
|
||||
theDimTols.Append(aGNode->GetChild(i)->Label());
|
||||
}
|
||||
aResult = Standard_True;
|
||||
}
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -462,16 +571,14 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefDimensionLabels(const TDF_Label& theS
|
||||
Standard_Boolean XCAFDoc_DimTolTool::GetRefGeomToleranceLabels(const TDF_Label& theShapeL,
|
||||
TDF_LabelSequence& theDimTols) const
|
||||
{
|
||||
Handle(TDataStd_TreeNode) aNode;
|
||||
if( !theShapeL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aNode) ||
|
||||
!aNode->HasFirst() ) {
|
||||
Handle(XCAFDoc_GraphNode) aGNode;
|
||||
if( !theShapeL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aGNode) ||
|
||||
aGNode->NbChildren() == 0 ) {
|
||||
return Standard_False;
|
||||
}
|
||||
Handle(TDataStd_TreeNode) aLast = aNode->First();
|
||||
theDimTols.Append(aLast->Label());
|
||||
while(aLast->HasNext()) {
|
||||
aLast = aLast->Next();
|
||||
theDimTols.Append(aLast->Label());
|
||||
for(Standard_Integer i = 1; i <= aGNode->NbChildren(); i++)
|
||||
{
|
||||
theDimTols.Append(aGNode->GetChild(i)->Label());
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -482,15 +589,20 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefGeomToleranceLabels(const TDF_Label&
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XCAFDoc_DimTolTool::GetRefDatumLabel(const TDF_Label& theShapeL,
|
||||
TDF_Label& theDatum) const
|
||||
TDF_LabelSequence& theDatum) const
|
||||
{
|
||||
Handle(TDataStd_TreeNode) aNode;
|
||||
if( !theShapeL.FindAttribute(XCAFDoc::DatumRefGUID(),aNode) ||
|
||||
!aNode->HasFirst() ) {
|
||||
return Standard_False;
|
||||
}
|
||||
Handle(TDataStd_TreeNode) aLast = aNode->First();
|
||||
theDatum = aLast->Label();
|
||||
Handle(TDataStd_TreeNode) aFirst = aNode->First();
|
||||
theDatum.Append(aFirst->Label());
|
||||
for(Standard_Integer i = 1; i < aNode->NbChildren(); i++)
|
||||
{
|
||||
aFirst = aFirst->Next();
|
||||
theDatum.Append(aFirst->Label());
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -68,6 +68,9 @@ public:
|
||||
//! in the DGTtable
|
||||
Standard_EXPORT void GetDimensionLabels (TDF_LabelSequence& theLabels) const;
|
||||
|
||||
//! Sets a link with GUID
|
||||
Standard_EXPORT void SetDimension (const TDF_LabelSequence& theFirstLS, const TDF_LabelSequence& theSecondLS, const TDF_Label& theDimTolL) const;
|
||||
|
||||
//! Sets a link with GUID
|
||||
Standard_EXPORT void SetDimension (const TDF_Label& theFirstL, const TDF_Label& theSecondL, const TDF_Label& theDimTolL) const;
|
||||
|
||||
@@ -90,6 +93,9 @@ public:
|
||||
|
||||
//! Sets a link with GUID
|
||||
Standard_EXPORT void SetGeomTolerance (const TDF_Label& theL, const TDF_Label& theDimTolL) const;
|
||||
|
||||
//! Sets a link with GUID
|
||||
Standard_EXPORT void SetGeomTolerance (const TDF_LabelSequence& theL, const TDF_Label& theDimTolL) const;
|
||||
|
||||
//! Returns all GeomTolerance labels defined for label ShapeL
|
||||
Standard_EXPORT Standard_Boolean GetRefGeomToleranceLabels (const TDF_Label& theShapeL, TDF_LabelSequence& theDimTols) const;
|
||||
@@ -126,7 +132,7 @@ public:
|
||||
|
||||
//! Returns ShapeL defined for label DimTolL
|
||||
//! Returns False if the DimTolL is not in DGTtable
|
||||
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& DimTolL, TDF_LabelSequence& ShapeL) const;
|
||||
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& DimTolL, TDF_LabelSequence& ShapeLFirst, TDF_LabelSequence& ShapeLSecond) const;
|
||||
|
||||
//! Returns all DimTol labels defined for label ShapeL
|
||||
Standard_EXPORT Standard_Boolean GetRefDGTLabels (const TDF_Label& ShapeL, TDF_LabelSequence& DimTols) const;
|
||||
@@ -175,7 +181,7 @@ public:
|
||||
Standard_EXPORT Standard_Boolean GetTolerOfDatumLabels (const TDF_Label& theDatumL, TDF_LabelSequence& theTols) const;
|
||||
|
||||
//! Returns Datum label defined for label ShapeL
|
||||
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL, TDF_Label& theDatum) const;
|
||||
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL, TDF_LabelSequence& theDatum) const;
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <XCAFDoc_Dimension.hxx>
|
||||
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <XCAFDoc.hxx>
|
||||
#include <TDataStd_TreeNode.hxx>
|
||||
#include <Precision.hxx>
|
||||
@@ -38,7 +39,10 @@ enum ChildLab
|
||||
ChildLab_Modifiers,
|
||||
ChildLab_Path,
|
||||
ChildLab_Dir,
|
||||
ChildLab_Pnts
|
||||
ChildLab_Pnts,
|
||||
ChildLab_PlaneLoc,
|
||||
ChildLab_PlaneN,
|
||||
ChildLab_PlaneRef,
|
||||
};
|
||||
|
||||
//=======================================================================
|
||||
@@ -86,78 +90,59 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
|
||||
{
|
||||
Backup();
|
||||
|
||||
Handle(TDataStd_Integer) aType;
|
||||
if(!Label().FindChild(ChildLab_Type).FindAttribute(TDataStd_Integer::GetID(), aType))
|
||||
//Label().ForForgetAllAttributes();
|
||||
TDF_ChildIterator anIter(Label());
|
||||
for(;anIter.More(); anIter.Next())
|
||||
{
|
||||
aType = new TDataStd_Integer();
|
||||
Label().FindChild(ChildLab_Type).AddAttribute(aType);
|
||||
anIter.Value().ForgetAllAttributes();
|
||||
}
|
||||
Handle(TDataStd_Integer) aType = new TDataStd_Integer();
|
||||
Label().FindChild(ChildLab_Type).AddAttribute(aType);
|
||||
aType->Set(theObject->GetType());
|
||||
|
||||
if(theObject->GetValues().IsNull())
|
||||
if(!theObject->GetValues().IsNull())
|
||||
{
|
||||
Label().FindChild(ChildLab_Value).ForgetAllAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(TDataStd_RealArray) aVal;
|
||||
if(!Label().FindChild(ChildLab_Value).FindAttribute(TDataStd_RealArray::GetID(), aVal))
|
||||
{
|
||||
aVal = new TDataStd_RealArray();
|
||||
Label().FindChild(ChildLab_Value).AddAttribute(aVal);
|
||||
}
|
||||
Handle(TDataStd_RealArray) aVal = new TDataStd_RealArray();
|
||||
Label().FindChild(ChildLab_Value).AddAttribute(aVal);
|
||||
aVal->ChangeArray(theObject->GetValues());
|
||||
}
|
||||
|
||||
Handle(TDataStd_Integer) aQualifier;
|
||||
if(!Label().FindChild(ChildLab_Qualifier).FindAttribute(TDataStd_Integer::GetID(), aQualifier))
|
||||
{
|
||||
aQualifier = new TDataStd_Integer();
|
||||
Label().FindChild(ChildLab_Qualifier).AddAttribute(aQualifier);
|
||||
}
|
||||
Handle(TDataStd_Integer) aQualifier = new TDataStd_Integer();
|
||||
Label().FindChild(ChildLab_Qualifier).AddAttribute(aQualifier);
|
||||
aQualifier->Set(theObject->GetQualifier());
|
||||
|
||||
Standard_Boolean aH;
|
||||
XCAFDimTolObjects_DimensionFormVariance aF;
|
||||
XCAFDimTolObjects_DimensionGrade aG;
|
||||
theObject->GetClassOfTolerance(aH,aF,aG);
|
||||
Handle(TDataStd_IntegerArray) aClass;
|
||||
if(!Label().FindChild(ChildLab_Class).FindAttribute(TDataStd_IntegerArray::GetID(), aClass))
|
||||
Handle(TColStd_HArray1OfInteger) anArrI;
|
||||
if(aF != XCAFDimTolObjects_DimensionFormVariance_None)
|
||||
{
|
||||
aClass = new TDataStd_IntegerArray();
|
||||
Handle(TDataStd_IntegerArray) aClass = new TDataStd_IntegerArray();
|
||||
Label().FindChild(ChildLab_Class).AddAttribute(aClass);
|
||||
anArrI = new TColStd_HArray1OfInteger(1,3);
|
||||
anArrI->SetValue(1,aH);
|
||||
anArrI->SetValue(2,aF);
|
||||
anArrI->SetValue(3,aG);
|
||||
aClass->ChangeArray(anArrI);
|
||||
}
|
||||
Handle(TColStd_HArray1OfInteger) anArrI = new TColStd_HArray1OfInteger(1,3);
|
||||
anArrI->SetValue(1,aH);
|
||||
anArrI->SetValue(2,aF);
|
||||
anArrI->SetValue(3,aG);
|
||||
aClass->ChangeArray(anArrI);
|
||||
|
||||
Standard_Integer aL, aR;
|
||||
theObject->GetNbOfDecimalPlaces(aL, aR);
|
||||
Handle(TDataStd_IntegerArray) aDec;
|
||||
if(!Label().FindChild(ChildLab_Dec).FindAttribute(TDataStd_IntegerArray::GetID(), aDec))
|
||||
if (aL > 0 && aR > 0)
|
||||
{
|
||||
aDec = new TDataStd_IntegerArray();
|
||||
Handle(TDataStd_IntegerArray) aDec = new TDataStd_IntegerArray();
|
||||
Label().FindChild(ChildLab_Dec).AddAttribute(aDec);
|
||||
anArrI = new TColStd_HArray1OfInteger(1,2);
|
||||
anArrI->SetValue(1,aL);
|
||||
anArrI->SetValue(2,aR);
|
||||
aDec->ChangeArray(anArrI);
|
||||
}
|
||||
anArrI = new TColStd_HArray1OfInteger(1,2);
|
||||
anArrI->SetValue(1,aL);
|
||||
anArrI->SetValue(2,aR);
|
||||
aDec->ChangeArray(anArrI);
|
||||
|
||||
if(theObject->GetModifiers().Length() == 0)
|
||||
|
||||
if(theObject->GetModifiers().Length() > 0)
|
||||
{
|
||||
Label().FindChild(ChildLab_Modifiers).ForgetAllAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(TDataStd_IntegerArray) aModifiers;
|
||||
if(!Label().FindChild(ChildLab_Modifiers).FindAttribute(TDataStd_IntegerArray::GetID(), aModifiers))
|
||||
{
|
||||
aModifiers = new TDataStd_IntegerArray();
|
||||
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
|
||||
}
|
||||
Handle(TDataStd_IntegerArray) aModifiers = new TDataStd_IntegerArray();
|
||||
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
|
||||
anArrI = new TColStd_HArray1OfInteger(1,theObject->GetModifiers().Length());
|
||||
for(Standard_Integer i = 1; i <= theObject->GetModifiers().Length(); i++)
|
||||
anArrI->SetValue(i,theObject->GetModifiers().Value(i));
|
||||
@@ -166,46 +151,67 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
|
||||
|
||||
if(!theObject->GetPath().IsNull())
|
||||
{
|
||||
TNaming_Builder tnBuild(Label().FindChild(ChildLab_Path));
|
||||
tnBuild.Generated(theObject->GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
Label().FindChild(ChildLab_Path).ForgetAllAttributes();
|
||||
TNaming_Builder tnBuild(Label().FindChild(ChildLab_Path));
|
||||
tnBuild.Generated(theObject->GetPath());
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aDir;
|
||||
if(!Label().FindChild(ChildLab_Dir).FindAttribute(TDataStd_RealArray::GetID(), aDir))
|
||||
Handle(TColStd_HArray1OfReal) anArrR;
|
||||
if(theObject->GetType() == XCAFDimTolObjects_DimensionType_Location_Oriented)
|
||||
{
|
||||
aDir = new TDataStd_RealArray();
|
||||
gp_Dir aD;
|
||||
theObject->GetDirection(aD);
|
||||
Handle(TDataStd_RealArray) aDir = new TDataStd_RealArray();
|
||||
Label().FindChild(ChildLab_Dir).AddAttribute(aDir);
|
||||
anArrR = new TColStd_HArray1OfReal(1,3);
|
||||
anArrR->SetValue(1,aD.X());
|
||||
anArrR->SetValue(2,aD.Y());
|
||||
anArrR->SetValue(3,aD.Z());
|
||||
aDir->ChangeArray(anArrR);
|
||||
}
|
||||
gp_Dir aD;
|
||||
theObject->GetDirection(aD);
|
||||
Handle(TColStd_HArray1OfReal) anArrR = new TColStd_HArray1OfReal(1,3);
|
||||
anArrR->SetValue(1,aD.X());
|
||||
anArrR->SetValue(2,aD.Y());
|
||||
anArrR->SetValue(3,aD.Z());
|
||||
aDir->ChangeArray(anArrR);
|
||||
|
||||
Handle(TDataStd_RealArray) aPnts;
|
||||
if(!Label().FindChild(ChildLab_Pnts).FindAttribute(TDataStd_RealArray::GetID(), aPnts))
|
||||
{
|
||||
aPnts = new TDataStd_RealArray();
|
||||
Label().FindChild(ChildLab_Pnts).AddAttribute(aPnts);
|
||||
}
|
||||
Handle(TColgp_HArray1OfPnt) aP = theObject->GetPoints();
|
||||
if(!aP.IsNull() && aP->Length() > 0)
|
||||
{
|
||||
anArrR = new TColStd_HArray1OfReal(1,6);
|
||||
anArrR = new TColStd_HArray1OfReal(1,aP->Length() * 3);
|
||||
Handle(TDataStd_RealArray) aPnts;
|
||||
anArrR->SetValue(1,aP->Value(1).X());
|
||||
anArrR->SetValue(2,aP->Value(1).Y());
|
||||
anArrR->SetValue(3,aP->Value(1).Z());
|
||||
anArrR->SetValue(4,aP->Value(2).X());
|
||||
anArrR->SetValue(5,aP->Value(2).Y());
|
||||
anArrR->SetValue(6,aP->Value(2).Z());
|
||||
if (aP->Length() == 2) {
|
||||
anArrR->SetValue(4,aP->Value(2).X());
|
||||
anArrR->SetValue(5,aP->Value(2).Y());
|
||||
anArrR->SetValue(6,aP->Value(2).Z());
|
||||
}
|
||||
aPnts = new TDataStd_RealArray();
|
||||
Label().FindChild(ChildLab_Pnts).AddAttribute(aPnts);
|
||||
aPnts->ChangeArray(anArrR);
|
||||
}
|
||||
|
||||
if (theObject->HasPlane())
|
||||
{
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
|
||||
gp_Ax2 aPln = theObject->GetPlane();
|
||||
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aLocArr->SetValue(i, aPln.Location().Coord(i));
|
||||
aLoc->ChangeArray(aLocArr);
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aNArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aNArr->SetValue(i, aPln.Direction().Coord(i));
|
||||
aN->ChangeArray(aNArr);
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aRArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aRArr->SetValue(i, aPln.XDirection().Coord(i));
|
||||
aR->ChangeArray(aRArr);
|
||||
|
||||
Label().FindChild(ChildLab_PlaneLoc).AddAttribute(aLoc);
|
||||
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
|
||||
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -279,12 +285,29 @@ Handle(XCAFDimTolObjects_DimensionObject) XCAFDoc_Dimension::GetObject() const
|
||||
if(Label().FindChild(ChildLab_Pnts).FindAttribute(TDataStd_RealArray::GetID(), aPnts)
|
||||
&& !aPnts->Array().IsNull() && aPnts->Array()->Length() > 0)
|
||||
{
|
||||
Handle(TColgp_HArray1OfPnt) aP = new TColgp_HArray1OfPnt(1,2);
|
||||
Handle(TColgp_HArray1OfPnt) aP = new TColgp_HArray1OfPnt(1,aPnts->Array()->Length());
|
||||
aP->SetValue(1, gp_Pnt(aPnts->Array()->Value(1), aPnts->Array()->Value(2), aPnts->Array()->Value(3)));
|
||||
aP->SetValue(2, gp_Pnt(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6)));
|
||||
if (aPnts->Array()->Length() == 2)
|
||||
{
|
||||
aP->SetValue(2, gp_Pnt(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6)));
|
||||
}
|
||||
anObj->SetPoints(aP);
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aLoc;
|
||||
Handle(TDataStd_RealArray) aN;
|
||||
Handle(TDataStd_RealArray) aR;
|
||||
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_PlaneN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_PlaneRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aL(aLoc->Value(aLoc->Lower()), aLoc->Value(aLoc->Lower()+1), aLoc->Value(aLoc->Lower()+2));
|
||||
gp_Dir aD(aN->Value(aN->Lower()), aN->Value(aN->Lower()+1), aN->Value(aN->Lower()+2));
|
||||
gp_Dir aDR(aR->Value(aR->Lower()), aR->Value(aR->Lower()+1), aR->Value(aR->Lower()+2));
|
||||
gp_Ax2 anAx(aL, aD, aDR);
|
||||
anObj->SetPlane(anAx);
|
||||
}
|
||||
|
||||
return anObj;
|
||||
}
|
||||
|
||||
|
@@ -14,10 +14,12 @@
|
||||
#include <XCAFDoc_GeomTolerance.hxx>
|
||||
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <XCAFDoc.hxx>
|
||||
#include <TDataStd_TreeNode.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
#include <TDataStd_IntegerArray.hxx>
|
||||
#include <TDataStd_RealArray.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <XCAFDimTolObjects_GeomToleranceObject.hxx>
|
||||
|
||||
@@ -30,7 +32,14 @@ enum ChildLab
|
||||
ChildLab_ZoneModif,
|
||||
ChildLab_ValueOfZoneModif,
|
||||
ChildLab_Modifiers,
|
||||
ChildLab_aMaxValueModif
|
||||
ChildLab_aMaxValueModif,
|
||||
ChildLab_AxisLoc,
|
||||
ChildLab_AxisN,
|
||||
ChildLab_AxisRef,
|
||||
ChildLab_PlaneLoc,
|
||||
ChildLab_PlaneN,
|
||||
ChildLab_PlaneRef,
|
||||
ChildLab_Pnt,
|
||||
};
|
||||
|
||||
//=======================================================================
|
||||
@@ -80,80 +89,127 @@ void XCAFDoc_GeomTolerance::SetObject (const Handle(XCAFDimTolObjects_GeomTolera
|
||||
{
|
||||
Backup();
|
||||
|
||||
Handle(TDataStd_Integer) aType;
|
||||
if(!Label().FindChild(ChildLab_Type).FindAttribute(TDataStd_Integer::GetID(), aType))
|
||||
//Label().ForForgetAllAttributes();
|
||||
TDF_ChildIterator anIter(Label());
|
||||
for(;anIter.More(); anIter.Next())
|
||||
{
|
||||
aType = new TDataStd_Integer();
|
||||
Label().FindChild(ChildLab_Type).AddAttribute(aType);
|
||||
anIter.Value().ForgetAllAttributes();
|
||||
}
|
||||
aType->Set(theObject->GetType());
|
||||
|
||||
Handle(TDataStd_Integer) aTypeOfValue;
|
||||
if(!Label().FindChild(ChildLab_TypeOfValue).FindAttribute(TDataStd_Integer::GetID(), aTypeOfValue))
|
||||
Handle(TDataStd_Integer) aType = new TDataStd_Integer();
|
||||
aType->Set(theObject->GetType());
|
||||
Label().FindChild(ChildLab_Type).AddAttribute(aType);
|
||||
|
||||
if(theObject->GetTypeOfValue() != XCAFDimTolObjects_GeomToleranceTypeValue_None)
|
||||
{
|
||||
aTypeOfValue = new TDataStd_Integer();
|
||||
Handle(TDataStd_Integer) aTypeOfValue = new TDataStd_Integer();
|
||||
aTypeOfValue->Set(theObject->GetTypeOfValue());
|
||||
Label().FindChild(ChildLab_TypeOfValue).AddAttribute(aTypeOfValue);
|
||||
}
|
||||
aTypeOfValue->Set(theObject->GetTypeOfValue());
|
||||
|
||||
Handle(TDataStd_Real) aValue;
|
||||
if(!Label().FindChild(ChildLab_Value).FindAttribute(TDataStd_Real::GetID(), aValue))
|
||||
{
|
||||
aValue = new TDataStd_Real();
|
||||
Label().FindChild(ChildLab_Value).AddAttribute(aValue);
|
||||
}
|
||||
Handle(TDataStd_Real) aValue = new TDataStd_Real();
|
||||
aValue->Set(theObject->GetValue());
|
||||
Label().FindChild(ChildLab_Value).AddAttribute(aValue);
|
||||
|
||||
Handle(TDataStd_Integer) aMatReqModif;
|
||||
if(!Label().FindChild(ChildLab_MatReqModif).FindAttribute(TDataStd_Integer::GetID(), aMatReqModif))
|
||||
if(theObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
|
||||
{
|
||||
Label().FindChild(ChildLab_MatReqModif).FindAttribute(TDataStd_Integer::GetID(), aMatReqModif);
|
||||
aMatReqModif = new TDataStd_Integer();
|
||||
Label().FindChild(ChildLab_MatReqModif).AddAttribute(aMatReqModif);
|
||||
aMatReqModif->Set(theObject->GetMaterialRequirementModifier());
|
||||
}
|
||||
aMatReqModif->Set(theObject->GetMaterialRequirementModifier());
|
||||
|
||||
Handle(TDataStd_Integer) aZoneModif;
|
||||
if(!Label().FindChild(ChildLab_ZoneModif).FindAttribute(TDataStd_Integer::GetID(), aZoneModif))
|
||||
if(theObject->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_None)
|
||||
{
|
||||
aZoneModif = new TDataStd_Integer();
|
||||
Handle(TDataStd_Integer) aZoneModif = new TDataStd_Integer();
|
||||
aZoneModif->Set(theObject->GetZoneModifier());
|
||||
Label().FindChild(ChildLab_ZoneModif).AddAttribute(aZoneModif);
|
||||
}
|
||||
aZoneModif->Set(theObject->GetZoneModifier());
|
||||
|
||||
Handle(TDataStd_Real) aValueOfZoneModif;
|
||||
if(!Label().FindChild(ChildLab_ValueOfZoneModif).FindAttribute(TDataStd_Real::GetID(), aValueOfZoneModif))
|
||||
|
||||
if(theObject->GetValueOfZoneModifier() > 0)
|
||||
{
|
||||
aValueOfZoneModif = new TDataStd_Real();
|
||||
Handle(TDataStd_Real) aValueOfZoneModif = new TDataStd_Real();
|
||||
aValueOfZoneModif->Set(theObject->GetValueOfZoneModifier());
|
||||
Label().FindChild(ChildLab_ValueOfZoneModif).AddAttribute(aValueOfZoneModif);
|
||||
}
|
||||
aValueOfZoneModif->Set(theObject->GetValueOfZoneModifier());
|
||||
|
||||
if(theObject->GetModifiers().Length() == 0)
|
||||
if(theObject->GetModifiers().Length() > 0)
|
||||
{
|
||||
Label().FindChild(ChildLab_Modifiers).ForgetAllAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(TDataStd_IntegerArray) aModifiers;
|
||||
if(!Label().FindChild(ChildLab_Modifiers).FindAttribute(TDataStd_IntegerArray::GetID(), aModifiers)
|
||||
|| theObject->GetModifiers().Length() == 0)
|
||||
{
|
||||
aModifiers = new TDataStd_IntegerArray();
|
||||
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
|
||||
}
|
||||
Handle(TDataStd_IntegerArray) aModifiers = new TDataStd_IntegerArray();
|
||||
Handle(TColStd_HArray1OfInteger) anArr = new TColStd_HArray1OfInteger(1,theObject->GetModifiers().Length());
|
||||
for(Standard_Integer i = 1; i <= theObject->GetModifiers().Length(); i++)
|
||||
anArr->SetValue(i,theObject->GetModifiers().Value(i));
|
||||
aModifiers->ChangeArray(anArr);
|
||||
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
|
||||
}
|
||||
|
||||
Handle(TDataStd_Real) aMaxValueModif;
|
||||
if(!Label().FindChild(ChildLab_aMaxValueModif).FindAttribute(TDataStd_Real::GetID(), aMaxValueModif))
|
||||
if(theObject->GetMaxValueModifier() > 0)
|
||||
{
|
||||
aMaxValueModif = new TDataStd_Real();
|
||||
Handle(TDataStd_Real) aMaxValueModif = new TDataStd_Real();
|
||||
aMaxValueModif->Set(theObject->GetMaxValueModifier());
|
||||
Label().FindChild(ChildLab_aMaxValueModif).AddAttribute(aMaxValueModif);
|
||||
}
|
||||
aMaxValueModif->Set(theObject->GetMaxValueModifier());
|
||||
|
||||
if(theObject->HasAxis())
|
||||
{
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
|
||||
gp_Ax2 anAx = theObject->GetAxis();
|
||||
aLoc->SetValue(aLoc->Upper(),anAx.Location().X());
|
||||
aLoc->SetValue(aLoc->Upper()+1,anAx.Location().Y());
|
||||
aLoc->SetValue(aLoc->Upper()+2,anAx.Location().Z());
|
||||
|
||||
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
|
||||
aN->SetValue(aN->Upper()+1,anAx.Axis().Direction().Y());
|
||||
aN->SetValue(aN->Upper()+2,anAx.Axis().Direction().Z());
|
||||
|
||||
aR->SetValue(aR->Upper(),anAx.Direction().X());
|
||||
aR->SetValue(aR->Upper()+1,anAx.Direction().Y());
|
||||
aR->SetValue(aR->Upper()+2,anAx.Direction().Z());
|
||||
|
||||
Label().FindChild(ChildLab_AxisLoc).AddAttribute(aLoc);
|
||||
Label().FindChild(ChildLab_AxisN).AddAttribute(aN);
|
||||
Label().FindChild(ChildLab_AxisRef).AddAttribute(aR);
|
||||
}
|
||||
|
||||
if (theObject->HasPlane())
|
||||
{
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
|
||||
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
|
||||
gp_Ax2 aPln = theObject->GetPlane();
|
||||
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aLocArr->SetValue(i, aPln.Location().Coord(i));
|
||||
aLoc->ChangeArray(aLocArr);
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aNArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aNArr->SetValue(i, aPln.Direction().Coord(i));
|
||||
aN->ChangeArray(aNArr);
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aRArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aRArr->SetValue(i, aPln.XDirection().Coord(i));
|
||||
aR->ChangeArray(aRArr);
|
||||
|
||||
Label().FindChild(ChildLab_PlaneLoc).AddAttribute(aLoc);
|
||||
Label().FindChild(ChildLab_PlaneN).AddAttribute(aN);
|
||||
Label().FindChild(ChildLab_PlaneRef).AddAttribute(aR);
|
||||
}
|
||||
|
||||
if (theObject->HasPoint())
|
||||
{
|
||||
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
|
||||
gp_Pnt aPnt = theObject->GetPoint();
|
||||
Handle(TColStd_HArray1OfReal) aLocArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aLocArr->SetValue(i, aPnt.Coord(i));
|
||||
aLoc->ChangeArray(aLocArr);
|
||||
Label().FindChild(ChildLab_Pnt).AddAttribute(aLoc);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -216,7 +272,38 @@ Handle(XCAFDimTolObjects_GeomToleranceObject) XCAFDoc_GeomTolerance::GetObject()
|
||||
{
|
||||
anObj->SetMaxValueModifier(aMaxValueModif->Get());
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aLoc;
|
||||
Handle(TDataStd_RealArray) aN;
|
||||
Handle(TDataStd_RealArray) aR;
|
||||
if(Label().FindChild(ChildLab_AxisLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_AxisN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_AxisRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aL(aLoc->Value(aLoc->Upper()), aLoc->Value(aLoc->Upper()+1), aLoc->Value(aLoc->Upper()+2));
|
||||
gp_Dir aD(aN->Value(aN->Upper()), aN->Value(aN->Upper()+1), aN->Value(aN->Upper()+2));
|
||||
gp_Dir aDR(aR->Value(aR->Upper()), aR->Value(aR->Upper()+1), aR->Value(aR->Upper()+2));
|
||||
gp_Ax2 anAx(aL, aD, aDR);
|
||||
anObj->SetAxis(anAx);
|
||||
}
|
||||
|
||||
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_PlaneN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
|
||||
Label().FindChild(ChildLab_PlaneRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aL(aLoc->Value(aLoc->Lower()), aLoc->Value(aLoc->Lower()+1), aLoc->Value(aLoc->Lower()+2));
|
||||
gp_Dir aD(aN->Value(aN->Lower()), aN->Value(aN->Lower()+1), aN->Value(aN->Lower()+2));
|
||||
gp_Dir aDR(aR->Value(aR->Lower()), aR->Value(aR->Lower()+1), aR->Value(aR->Lower()+2));
|
||||
gp_Ax2 anAx(aL, aD, aDR);
|
||||
anObj->SetPlane(anAx);
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aPnt;
|
||||
if(Label().FindChild(ChildLab_PlaneLoc).FindAttribute(TDataStd_RealArray::GetID(), aPnt) && aPnt->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aP(aLoc->Value(aPnt->Lower()), aPnt->Value(aPnt->Lower()+1), aPnt->Value(aPnt->Lower()+2));
|
||||
anObj->SetPoint(aP);
|
||||
}
|
||||
return anObj;
|
||||
}
|
||||
|
||||
|
@@ -595,7 +595,6 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
||||
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorSurf) ) type = "Surface Color Link";
|
||||
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorCurv) ) type = "Curve Color Link";
|
||||
else if ( att->ID() == XCAFDoc::DimTolRefGUID() ) type = "DGT Link";
|
||||
else if ( att->ID() == XCAFDoc::GeomToleranceRefGUID() ) type = "GeomTolerance Link";
|
||||
else if ( att->ID() == XCAFDoc::DatumRefGUID() ) type = "Datum Link";
|
||||
else if ( att->ID() == XCAFDoc::MaterialRefGUID() ) type = "Material Link";
|
||||
Handle(TDataStd_TreeNode) TN = Handle(TDataStd_TreeNode)::DownCast(att);
|
||||
@@ -763,8 +762,14 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
||||
else if ( att->ID() == XCAFDoc::DatumTolRefGUID() ) {
|
||||
type = "DatumToler Link";
|
||||
}
|
||||
else if ( att->ID() == XCAFDoc::DimensionRefGUID() ) {
|
||||
type = "Dimension Link";
|
||||
else if ( att->ID() == XCAFDoc::DimensionRefFirstGUID() ) {
|
||||
type = "Dimension Link First";
|
||||
}
|
||||
else if ( att->ID() == XCAFDoc::DimensionRefSecondGUID() ) {
|
||||
type = "Dimension Link Second";
|
||||
}
|
||||
else if ( att->ID() == XCAFDoc::GeomToleranceRefGUID() ){
|
||||
type = "GeomTolerance Link";
|
||||
}
|
||||
else return 0;
|
||||
|
||||
|
@@ -123,7 +123,7 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
{
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aLabels.Value(i), Entry);
|
||||
di << "\n " << Entry;
|
||||
di << "\n " << Entry << " Shape" << "."<< i;
|
||||
flag = Standard_False;
|
||||
}
|
||||
TCollection_AsciiString Entry;
|
||||
@@ -131,7 +131,54 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
di << "\n \t " << Entry;
|
||||
flag = Standard_False;
|
||||
|
||||
di << " Dimension";
|
||||
di << " Dimension" << "."<< i << "."<< j;
|
||||
if (argc > 3)
|
||||
{
|
||||
di <<" (";
|
||||
di << " T " << aDimTolObj->GetType();
|
||||
if(aDimTolObj->IsDimWithRange())
|
||||
{
|
||||
di << ", LB " << aDimTolObj->GetLowerBound();
|
||||
di << ", UB " << aDimTolObj->GetUpperBound();
|
||||
}
|
||||
else
|
||||
{
|
||||
di << ", V " << aDimTolObj->GetValue();
|
||||
if (aDimTolObj->IsDimWithPlusMinusTolerance())
|
||||
{
|
||||
di << ", VL " << aDimTolObj->GetLowerTolValue();
|
||||
di << ", VU " << aDimTolObj->GetUpperTolValue();
|
||||
}
|
||||
else if (aDimTolObj->IsDimWithClassOfTolerance())
|
||||
{
|
||||
Standard_Boolean isH;
|
||||
XCAFDimTolObjects_DimensionFormVariance aFV;
|
||||
XCAFDimTolObjects_DimensionGrade aG;
|
||||
aDimTolObj->GetClassOfTolerance(isH, aFV, aG);
|
||||
di << ", H " << (Standard_Integer)isH<< " F " << aFV << " G " << aG;
|
||||
}
|
||||
}
|
||||
if (aDimTolObj->HasQualifier())
|
||||
di << ", Q " << aDimTolObj->GetQualifier();
|
||||
if (aDimTolObj->GetType() == XCAFDimTolObjects_DimensionType_Location_Oriented)
|
||||
{
|
||||
gp_Dir aD;
|
||||
aDimTolObj->GetDirection(aD);
|
||||
di << ", D (" << aD.X() << ", " << aD.Y() << ", " << aD.Z() << ")";
|
||||
}
|
||||
XCAFDimTolObjects_DimensionModifiersSequence aModif =
|
||||
aDimTolObj->GetModifiers();
|
||||
if (!aModif.IsEmpty())
|
||||
{
|
||||
di << ",";
|
||||
for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
|
||||
{
|
||||
di << " M " << aModif.Value(k);
|
||||
}
|
||||
}
|
||||
di << ", P " << (Standard_Integer)!aDimTolObj->GetPath().IsNull();
|
||||
di << " )";
|
||||
}
|
||||
}
|
||||
}
|
||||
aGDTs.Clear();
|
||||
@@ -146,7 +193,7 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
{
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aLabels.Value(i), Entry);
|
||||
di << "\n " << Entry;
|
||||
di << "\n " << Entry << " Shape" << "."<< i;
|
||||
flag = Standard_False;
|
||||
}
|
||||
TCollection_AsciiString Entry;
|
||||
@@ -154,7 +201,50 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
di << "\n \t " << Entry;
|
||||
flag = Standard_False;
|
||||
|
||||
di << " GeomTolerance";
|
||||
di << " GeomTolerance" << "."<< i << "."<< j;
|
||||
if (argc > 3)
|
||||
{
|
||||
di <<" (";
|
||||
di << " T " << aDimTolObj->GetType();
|
||||
di << " TV " << aDimTolObj->GetTypeOfValue();
|
||||
di << ", V " << aDimTolObj->GetValue();
|
||||
|
||||
if (aDimTolObj->HasAxis())
|
||||
{
|
||||
gp_Ax2 anAx = aDimTolObj->GetAxis();
|
||||
di << ", A ( L (" << anAx.Location().X() << anAx.Location().Y() << anAx.Location().Z()
|
||||
<< "), XD (" << anAx.XDirection().X() << anAx.XDirection().Y() << anAx.XDirection().Z()
|
||||
<< "), RD (" << anAx.YDirection().X() << anAx.YDirection().Y() << anAx.YDirection().Z() << "))";
|
||||
}
|
||||
XCAFDimTolObjects_GeomToleranceModifiersSequence aModif =
|
||||
aDimTolObj->GetModifiers();
|
||||
if (!aModif.IsEmpty())
|
||||
{
|
||||
di << ",";
|
||||
for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
|
||||
{
|
||||
di << " M " << aModif.Value(k);
|
||||
}
|
||||
}
|
||||
if (aDimTolObj->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
|
||||
{
|
||||
di << ", MR " << aDimTolObj->GetMaterialRequirementModifier();
|
||||
}
|
||||
if (aDimTolObj->GetMaxValueModifier() > 0)
|
||||
{
|
||||
di << "MaxV " << aDimTolObj->GetMaxValueModifier();
|
||||
}
|
||||
if ( aDimTolObj->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_None)
|
||||
{
|
||||
di << ", ZM " << aDimTolObj->GetZoneModifier();
|
||||
if (aDimTolObj->GetValueOfZoneModifier() > 0)
|
||||
{
|
||||
di << " ZMV " <<aDimTolObj->GetValueOfZoneModifier();
|
||||
}
|
||||
}
|
||||
|
||||
di << " )";
|
||||
}
|
||||
Handle(XCAFDoc_GraphNode) aNode;
|
||||
if(aGDTs.Value(j).FindAttribute(XCAFDoc::DatumTolRefGUID(), aNode) && aNode->NbChildren() > 0)
|
||||
{
|
||||
@@ -163,40 +253,153 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
Handle(XCAFDoc_Datum) aDatum;
|
||||
if(aNode->GetChild(k)->Label().FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
|
||||
{
|
||||
Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatum->GetObject();
|
||||
TCollection_AsciiString anEntry;
|
||||
TDF_Tool::Entry(aNode->GetChild(k)->Label(), anEntry);
|
||||
di << "\n \t \t " << anEntry;
|
||||
di << " Datum";
|
||||
di << " Datum" << "."<< i << "."<< j << "."<< k;
|
||||
if (argc > 3)
|
||||
{
|
||||
di <<" (";
|
||||
XCAFDimTolObjects_DatumModifiersSequence aModif =
|
||||
aDatumObj->GetModifiers();
|
||||
if (!aModif.IsEmpty())
|
||||
{
|
||||
di << ",";
|
||||
for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
|
||||
{
|
||||
di << " M " << aModif.Value(k);
|
||||
}
|
||||
}
|
||||
XCAFDimTolObjects_DatumModifWithValue aM;
|
||||
Standard_Real aV;
|
||||
aDatumObj->GetModifierWithValue(aM, aV);
|
||||
if (aM != XCAFDimTolObjects_DatumModifWithValue_None)
|
||||
{
|
||||
di << ", MV" << aM << " " << aV;
|
||||
}
|
||||
di << " )";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TDF_Label aDatumL;
|
||||
TDF_LabelSequence aDatumL;
|
||||
if (aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatumL))
|
||||
{
|
||||
Handle(XCAFDoc_Datum) aDatum;
|
||||
if(aDatumL.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
|
||||
for(Standard_Integer j = aDatumL.Lower(); j <= aDatumL.Upper(); j++)
|
||||
{
|
||||
if(flag)
|
||||
Handle(XCAFDoc_Datum) aDatum;
|
||||
if(aDatumL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDatum) &&
|
||||
aDatum->GetObject()->IsDatumTarget())
|
||||
{
|
||||
Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatum->GetObject();
|
||||
if(flag)
|
||||
{
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aLabels.Value(i), Entry);
|
||||
di << "\n " << Entry << " Shape" << "."<< i;
|
||||
flag = Standard_False;
|
||||
}
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aLabels.Value(i), Entry);
|
||||
di << "\n " << Entry;
|
||||
TDF_Tool::Entry(aDatumL.First(), Entry);
|
||||
di << "\n \t " << Entry;
|
||||
flag = Standard_False;
|
||||
}
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aDatumL, Entry);
|
||||
di << "\n \t " << Entry;
|
||||
flag = Standard_False;
|
||||
|
||||
di << " Datum";
|
||||
di << " Datum target" << "."<< i << "."<< j;
|
||||
if (argc > 3)
|
||||
{
|
||||
di <<" (";
|
||||
di << " T " << aDatumObj->GetDatumTargetType();
|
||||
if (aDatumObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Area)
|
||||
{
|
||||
gp_Ax2 anAx = aDatumObj->GetDatumTargetAxis();
|
||||
di << ", A ( L (" << anAx.Location().X() << anAx.Location().Y() << anAx.Location().Z()
|
||||
<< "), XD (" << anAx.XDirection().X() << anAx.XDirection().Y() << anAx.XDirection().Z()
|
||||
<< "), RD (" << anAx.YDirection().X() << anAx.YDirection().Y() << anAx.YDirection().Z() << "))";
|
||||
if (aDatumObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
|
||||
{
|
||||
di << ", L " << aDatumObj->GetDatumTargetLength() ;
|
||||
if (aDatumObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
|
||||
{
|
||||
di << ", W " << aDatumObj->GetDatumTargetWidth() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
di << " )";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
di<<"Use: "<<"XDumpNbDGTs Doc";
|
||||
return 1;
|
||||
}
|
||||
Handle(TDocStd_Document) Doc;
|
||||
DDocStd::GetDocument(argv[1], Doc);
|
||||
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
|
||||
Handle(XCAFDoc_DimTolTool) aDimTolTool= XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
|
||||
Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
|
||||
|
||||
TDF_LabelSequence aLabels;
|
||||
aShapeTool->GetShapes(aLabels);
|
||||
for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
|
||||
{
|
||||
aShapeTool->GetSubShapes(aLabels.Value(i), aLabels);
|
||||
}
|
||||
|
||||
TDF_LabelSequence aGDTs;
|
||||
aDimTolTool->GetDimensionLabels(aGDTs);
|
||||
di << "\n NbOfDimensions : " << aGDTs.Length();
|
||||
|
||||
aGDTs.Clear();
|
||||
aDimTolTool->GetGeomToleranceLabels(aGDTs);
|
||||
di << "\n NbOfTolerances : " << aGDTs.Length();
|
||||
|
||||
Standard_Integer aCounter = 0;
|
||||
Standard_Integer aCounter1 = 0;
|
||||
Standard_Integer aCounter2 = 0;
|
||||
|
||||
for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
|
||||
{
|
||||
Standard_Boolean isDatum = Standard_False;
|
||||
TDF_LabelSequence aDatL;
|
||||
if(aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatL))
|
||||
{
|
||||
for(Standard_Integer j = aDatL.Lower(); j <= aDatL.Upper(); j++)
|
||||
{
|
||||
Handle(XCAFDoc_Datum) aDat;
|
||||
if(aDatL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDat))
|
||||
{
|
||||
if(aDat->GetObject()->IsDatumTarget())
|
||||
{
|
||||
aCounter1++;
|
||||
}
|
||||
else
|
||||
{
|
||||
aCounter2++;
|
||||
isDatum = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isDatum)
|
||||
aCounter++;
|
||||
}
|
||||
}
|
||||
di << "\n NbOfDatumFeature : " << aCounter;
|
||||
di << "\n NbOfAttachedDatum : " << aCounter2;
|
||||
di << "\n NbOfDatumTarget : " << aCounter1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Standard_Integer addDim (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3) {
|
||||
@@ -378,25 +581,16 @@ static Standard_Integer getDatum (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
return 1;
|
||||
}
|
||||
|
||||
TDF_Label aD;
|
||||
TDF_LabelSequence aD;
|
||||
if(!aDimTolTool->GetRefDatumLabel(aLabel, aD))
|
||||
{
|
||||
TDF_LabelSequence aDS;
|
||||
if(aDimTolTool->GetDatumOfTolerLabels(aLabel, aDS))
|
||||
{
|
||||
for(Standard_Integer i = 1; i<=aDS.Length();i++)
|
||||
{
|
||||
if(i>1) di<<", ";
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aDS.Value(i), Entry);
|
||||
di<<Entry;
|
||||
}
|
||||
}
|
||||
aDimTolTool->GetDatumOfTolerLabels(aLabel, aD);
|
||||
}
|
||||
else
|
||||
for(Standard_Integer i = aD.Lower(); i <= aD.Upper(); i++)
|
||||
{
|
||||
if(i>1) di<<", ";
|
||||
TCollection_AsciiString Entry;
|
||||
TDF_Tool::Entry(aD, Entry);
|
||||
TDF_Tool::Entry(aD.Value(i), Entry);
|
||||
di<<Entry;
|
||||
}
|
||||
return 0;
|
||||
@@ -1890,6 +2084,9 @@ void XDEDRAW_GDTs::InitCommands(Draw_Interpretor& di)
|
||||
di.Add ("XDumpDGTs","XDumpDGTs Doc shape/label/all ",
|
||||
__FILE__, DumpDGTs, g);
|
||||
|
||||
di.Add ("XDumpNbDGTs","XDumpDGTs Doc",
|
||||
__FILE__, DumpNbDGTs, g);
|
||||
|
||||
di.Add ("XAddDimension","XAddDimension Doc shape/label [shape/label]",
|
||||
__FILE__, addDim, g);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user