File indexing completed on 2026-09-25 09:21:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _PrsDim_Relation_HeaderFile
0018 #define _PrsDim_Relation_HeaderFile
0019
0020 #include <AIS_InteractiveObject.hxx>
0021 #include <Aspect_TypeOfLine.hxx>
0022 #include <Aspect_TypeOfMarker.hxx>
0023 #include <Bnd_Box.hxx>
0024 #include <DsgPrs_ArrowSide.hxx>
0025 #include <gp_Pln.hxx>
0026 #include <gp_Pnt.hxx>
0027 #include <PrsDim_KindOfDimension.hxx>
0028 #include <PrsDim_KindOfSurface.hxx>
0029 #include <TCollection_ExtendedString.hxx>
0030 #include <TopoDS_Shape.hxx>
0031
0032 class Geom_Curve;
0033 class Geom_Plane;
0034 class Geom_Surface;
0035 class TopoDS_Edge;
0036 class TopoDS_Vertex;
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 class PrsDim_Relation : public AIS_InteractiveObject
0048 {
0049 DEFINE_STANDARD_RTTIEXT(PrsDim_Relation, AIS_InteractiveObject)
0050 public:
0051
0052
0053 Standard_EXPORT void SetColor(const Quantity_Color& theColor) override;
0054
0055
0056
0057 Standard_EXPORT void UnsetColor() override;
0058
0059 AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Relation; }
0060
0061
0062 virtual PrsDim_KindOfDimension KindOfDimension() const { return PrsDim_KOD_NONE; }
0063
0064
0065 virtual bool IsMovable() const { return false; }
0066
0067 const TopoDS_Shape& FirstShape() const { return myFShape; }
0068
0069 virtual void SetFirstShape(const TopoDS_Shape& aFShape) { myFShape = aFShape; }
0070
0071
0072 const TopoDS_Shape& SecondShape() const { return mySShape; }
0073
0074
0075
0076 virtual void SetSecondShape(const TopoDS_Shape& aSShape) { mySShape = aSShape; }
0077
0078 void SetBndBox(const double theXmin,
0079 const double theYmin,
0080 const double theZmin,
0081 const double theXmax,
0082 const double theYmax,
0083 const double theZmax)
0084 {
0085 myBndBox.Update(theXmin, theYmin, theZmin, theXmax, theYmax, theZmax);
0086 myIsSetBndBox = true;
0087 }
0088
0089 void UnsetBndBox() { myIsSetBndBox = false; }
0090
0091
0092 const occ::handle<Geom_Plane>& Plane() const { return myPlane; }
0093
0094
0095
0096 void SetPlane(const occ::handle<Geom_Plane>& thePlane) { myPlane = thePlane; }
0097
0098
0099 double Value() const { return myVal; }
0100
0101
0102 void SetValue(const double theVal) { myVal = theVal; }
0103
0104
0105 const gp_Pnt& Position() const { return myPosition; }
0106
0107
0108
0109 void SetPosition(const gp_Pnt& thePosition)
0110 {
0111 myPosition = thePosition;
0112 myAutomaticPosition = false;
0113 }
0114
0115
0116 const TCollection_ExtendedString& Text() const { return myText; }
0117
0118
0119 void SetText(const TCollection_ExtendedString& theText) { myText = theText; }
0120
0121
0122
0123 double ArrowSize() const { return myArrowSize; }
0124
0125
0126
0127 void SetArrowSize(const double theArrowSize)
0128 {
0129 myArrowSize = theArrowSize;
0130 myArrowSizeIsDefined = true;
0131 }
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143 DsgPrs_ArrowSide SymbolPrs() const { return mySymbolPrs; }
0144
0145
0146 void SetSymbolPrs(const DsgPrs_ArrowSide theSymbolPrs) { mySymbolPrs = theSymbolPrs; }
0147
0148
0149
0150
0151
0152
0153
0154 void SetExtShape(const int theIndex) { myExtShape = theIndex; }
0155
0156
0157 int ExtShape() const { return myExtShape; }
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173 bool AcceptDisplayMode(const int theMode) const override { return theMode == 0; }
0174
0175 void SetAutomaticPosition(const bool theStatus) { myAutomaticPosition = theStatus; }
0176
0177 bool AutomaticPosition() const { return myAutomaticPosition; }
0178
0179 protected:
0180 Standard_EXPORT PrsDim_Relation(
0181 const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
0182
0183
0184
0185
0186
0187
0188 Standard_EXPORT void ComputeProjEdgePresentation(
0189 const occ::handle<Prs3d_Presentation>& aPres,
0190 const TopoDS_Edge& anEdge,
0191 const occ::handle<Geom_Curve>& ProjCurve,
0192 const gp_Pnt& FirstP,
0193 const gp_Pnt& LastP,
0194 const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE,
0195 const double aWidth = 2,
0196 const Aspect_TypeOfLine aProjTOL = Aspect_TOL_DASH,
0197 const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT) const;
0198
0199
0200
0201
0202
0203 Standard_EXPORT void ComputeProjVertexPresentation(
0204 const occ::handle<Prs3d_Presentation>& aPres,
0205 const TopoDS_Vertex& aVertex,
0206 const gp_Pnt& ProjPoint,
0207 const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE,
0208 const double aWidth = 2,
0209 const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS,
0210 const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT) const;
0211
0212 protected:
0213 TopoDS_Shape myFShape;
0214 TopoDS_Shape mySShape;
0215 occ::handle<Geom_Plane> myPlane;
0216 double myVal;
0217 gp_Pnt myPosition;
0218 TCollection_ExtendedString myText;
0219 double myArrowSize;
0220 bool myAutomaticPosition;
0221 DsgPrs_ArrowSide mySymbolPrs;
0222 int myExtShape;
0223 gp_Pln myFirstPlane;
0224 gp_Pln mySecondPlane;
0225 occ::handle<Geom_Surface> myFirstBasisSurf;
0226 occ::handle<Geom_Surface> mySecondBasisSurf;
0227 PrsDim_KindOfSurface myFirstSurfType;
0228 PrsDim_KindOfSurface mySecondSurfType;
0229 double myFirstOffset;
0230 double mySecondOffset;
0231 Bnd_Box myBndBox;
0232 bool myIsSetBndBox;
0233 bool myArrowSizeIsDefined;
0234 };
0235
0236 #endif