1 #ifndef _ISession2D_Curve_HeaderFile 2 #define _ISession2D_Curve_HeaderFile 3 4 #include <Standard_Macro.hxx> 5 #include <Standard_DefineHandle.hxx> 6 7 #include <Aspect_TypeOfline.hxx> 8 #include <Aspect_WidthOfline.hxx> 9 #include <Standard_Integer.hxx> 10 #include <SelectMgr_SelectableObject.hxx> 11 #include <SelectMgr_Selection.hxx> 12 #include <Standard_OStream.hxx> 13 #include <Standard_IStream.hxx> 14 #include <Standard_CString.hxx> 15 16 #include <TColGeom2d_HSequenceOfCurve.hxx> 17 class PrsMgr_PresentationManager2d; 18 class Graphic2d_GraphicObject; 19 class SelectMgr_Selection; 20 21 #include "Geom2d_Curve.hxx" 22 23 #include "AIS_InteractiveObject.hxx" 24 class ISession2D_Curve; DEFINE_STANDARD_HANDLE(ISession2D_Curve,AIS_InteractiveObject)25DEFINE_STANDARD_HANDLE(ISession2D_Curve,AIS_InteractiveObject) 26 class ISession2D_Curve : public AIS_InteractiveObject { 27 28 public: 29 30 // Methods PUBLIC 31 // 32 33 ISession2D_Curve 34 (const Handle(Geom2d_Curve) aGeom2dCurve, 35 const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID, 36 const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM, 37 const Standard_Integer aColorIndex = 4); 38 39 inline Standard_Integer NbPossibleSelection() const; 40 41 inline Aspect_TypeOfLine GetTypeOfLine() const; 42 inline void SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine); 43 44 inline Aspect_WidthOfLine GetWidthOfLine() const; 45 inline void SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine); 46 47 inline Standard_Integer GetColorIndex() const; 48 inline void SetColorIndex(const Standard_Integer aNewColorIndex) ; 49 50 inline Standard_Boolean GetDisplayPole() const; 51 inline void SetDisplayPole(const Standard_Boolean aNewDisplayPole) ; 52 53 inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure() const; 54 inline void ISession2D_Curve::SetDisplayCurbure 55 (const Standard_Boolean aNewDisplayCurbure); 56 57 inline Standard_Real GetDiscretisation() const; 58 inline void SetDiscretisation(const Standard_Real aNewDiscretisation) ; 59 60 DEFINE_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject) 61 62 private: 63 64 // Methods PRIVATE 65 virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const { return theMode == 0; } 66 virtual void Compute(const Handle(PrsMgr_PresentationManager)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; 67 void ComputeSelection(const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {} 68 69 // Fields PRIVATE 70 // 71 Handle(Geom2d_Curve) myGeom2dCurve; 72 Aspect_TypeOfLine myTypeOfLine; 73 Aspect_WidthOfLine myWidthOfLine; 74 Standard_Integer myColorIndex; 75 Standard_Boolean myDisplayPole; 76 Standard_Boolean myDisplayCurbure; 77 Standard_Real myDiscretisation; 78 Standard_Real myradiusmax ; 79 Standard_Real myradiusratio ; 80 }; 81 82 83 84 // other inCurve functions and methods (like "C++: function call" methods) 85 // 86 NbPossibleSelection()87inline Standard_Integer ISession2D_Curve::NbPossibleSelection() const 88 { 89 return 1; 90 } 91 GetTypeOfLine()92inline Aspect_TypeOfLine ISession2D_Curve::GetTypeOfLine() const 93 { 94 return myTypeOfLine ; 95 } 96 SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine)97inline void ISession2D_Curve::SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine) 98 { 99 myTypeOfLine = aNewTypeOfLine; 100 } 101 GetWidthOfLine()102inline Aspect_WidthOfLine ISession2D_Curve::GetWidthOfLine() const 103 { 104 return myWidthOfLine ; 105 } 106 SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine)107inline void ISession2D_Curve::SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine) 108 { 109 myWidthOfLine = aNewWidthOfLine; 110 } 111 GetColorIndex()112inline Standard_Integer ISession2D_Curve::GetColorIndex() const 113 { 114 return myColorIndex ; 115 } 116 SetColorIndex(const Standard_Integer aNewColorIndex)117inline void ISession2D_Curve::SetColorIndex(const Standard_Integer aNewColorIndex) 118 { 119 myColorIndex = aNewColorIndex; 120 } 121 GetDisplayPole()122inline Standard_Boolean ISession2D_Curve::GetDisplayPole 123 () const 124 { 125 return myDisplayPole; 126 } SetDisplayPole(const Standard_Boolean aNewDisplayPole)127inline void ISession2D_Curve::SetDisplayPole 128 (const Standard_Boolean aNewDisplayPole) 129 { 130 myDisplayPole = aNewDisplayPole; 131 } 132 GetDisplayCurbure()133inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure 134 () const 135 { 136 return myDisplayCurbure; 137 } SetDisplayCurbure(const Standard_Boolean aNewDisplayCurbure)138inline void ISession2D_Curve::SetDisplayCurbure 139 (const Standard_Boolean aNewDisplayCurbure) 140 { 141 myDisplayCurbure = aNewDisplayCurbure; 142 } 143 144 GetDiscretisation()145inline Standard_Real ISession2D_Curve::GetDiscretisation 146 () const 147 { 148 return myDiscretisation; 149 } SetDiscretisation(const Standard_Real aNewDiscretisation)150inline void ISession2D_Curve::SetDiscretisation 151 (const Standard_Real aNewDiscretisation) 152 { 153 myDiscretisation = aNewDiscretisation; 154 } 155 156 157 158 #endif 159 160