File indexing completed on 2025-01-18 10:02:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _AIS_Line_HeaderFile
0018 #define _AIS_Line_HeaderFile
0019
0020 #include <AIS_InteractiveObject.hxx>
0021 #include <AIS_KindOfInteractive.hxx>
0022
0023 class Geom_Line;
0024 class Geom_Point;
0025
0026
0027
0028 class AIS_Line : public AIS_InteractiveObject
0029 {
0030 DEFINE_STANDARD_RTTIEXT(AIS_Line, AIS_InteractiveObject)
0031 public:
0032
0033
0034 Standard_EXPORT AIS_Line(const Handle(Geom_Line)& aLine);
0035
0036
0037
0038 Standard_EXPORT AIS_Line(const Handle(Geom_Point)& aStartPoint, const Handle(Geom_Point)& aEndPoint);
0039
0040
0041 virtual Standard_Integer Signature() const Standard_OVERRIDE { return 5; }
0042
0043
0044 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
0045
0046
0047 const Handle(Geom_Line)& Line() const { return myComponent; }
0048
0049
0050 void Points (Handle(Geom_Point)& thePStart, Handle(Geom_Point)& thePEnd) const
0051 {
0052 thePStart = myStartPoint;
0053 thePEnd = myEndPoint;
0054 }
0055
0056
0057 void SetLine (const Handle(Geom_Line)& theLine)
0058 {
0059 myComponent = theLine;
0060 myLineIsSegment = Standard_False;
0061 }
0062
0063
0064
0065 void SetPoints (const Handle(Geom_Point)& thePStart, const Handle(Geom_Point)& thePEnd)
0066 {
0067 myStartPoint = thePStart;
0068 myEndPoint = thePEnd;
0069 myLineIsSegment = Standard_True;
0070 }
0071
0072
0073 Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
0074
0075
0076
0077 Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
0078
0079
0080 Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
0081
0082
0083 Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
0084
0085 private:
0086
0087 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0088 const Handle(Prs3d_Presentation)& thePrs,
0089 const Standard_Integer theMode) Standard_OVERRIDE;
0090
0091 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0092 const Standard_Integer theMode) Standard_OVERRIDE;
0093
0094 Standard_EXPORT void ComputeInfiniteLine (const Handle(Prs3d_Presentation)& aPresentation);
0095
0096 Standard_EXPORT void ComputeSegmentLine (const Handle(Prs3d_Presentation)& aPresentation);
0097
0098 Standard_EXPORT void ComputeInfiniteLineSelection (const Handle(SelectMgr_Selection)& aSelection);
0099
0100 Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
0101
0102 void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
0103
0104 private:
0105
0106 Handle(Geom_Line) myComponent;
0107 Handle(Geom_Point) myStartPoint;
0108 Handle(Geom_Point) myEndPoint;
0109 Standard_Boolean myLineIsSegment;
0110
0111 };
0112
0113 DEFINE_STANDARD_HANDLE(AIS_Line, AIS_InteractiveObject)
0114
0115 #endif