File indexing completed on 2026-09-16 09:16:17
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 Standard_EXPORT AIS_Line(const occ::handle<Geom_Line>& aLine);
0034
0035
0036
0037 Standard_EXPORT AIS_Line(const occ::handle<Geom_Point>& aStartPoint,
0038 const occ::handle<Geom_Point>& aEndPoint);
0039
0040
0041 int Signature() const override { return 5; }
0042
0043
0044 AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Datum; }
0045
0046
0047 const occ::handle<Geom_Line>& Line() const { return myComponent; }
0048
0049
0050
0051 const occ::handle<Geom_Point>& StartPoint() const { return myStartPoint; }
0052
0053
0054
0055 const occ::handle<Geom_Point>& EndPoint() const { return myEndPoint; }
0056
0057
0058
0059 Standard_DEPRECATED("Use StartPoint() and EndPoint() instead")
0060 void Points(occ::handle<Geom_Point>& thePStart, occ::handle<Geom_Point>& thePEnd) const
0061 {
0062 thePStart = StartPoint();
0063 thePEnd = EndPoint();
0064 }
0065
0066
0067
0068 void SetLine(const occ::handle<Geom_Line>& theLine)
0069 {
0070 myComponent = theLine;
0071 myLineIsSegment = false;
0072 }
0073
0074
0075
0076
0077
0078 void SetPoints(const occ::handle<Geom_Point>& thePStart, const occ::handle<Geom_Point>& thePEnd)
0079 {
0080 myStartPoint = thePStart;
0081 myEndPoint = thePEnd;
0082 myLineIsSegment = true;
0083 }
0084
0085
0086 Standard_EXPORT void SetColor(const Quantity_Color& aColor) override;
0087
0088
0089
0090 Standard_EXPORT void SetWidth(const double aValue) override;
0091
0092
0093 Standard_EXPORT void UnsetColor() override;
0094
0095
0096 Standard_EXPORT void UnsetWidth() override;
0097
0098 private:
0099 Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0100 const occ::handle<Prs3d_Presentation>& thePrs,
0101 const int theMode) override;
0102
0103 Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0104 const int theMode) override;
0105
0106 Standard_EXPORT void ComputeInfiniteLine(const occ::handle<Prs3d_Presentation>& aPresentation);
0107
0108 Standard_EXPORT void ComputeSegmentLine(const occ::handle<Prs3d_Presentation>& aPresentation);
0109
0110 Standard_EXPORT void ComputeInfiniteLineSelection(
0111 const occ::handle<SelectMgr_Selection>& aSelection);
0112
0113 Standard_EXPORT void ComputeSegmentLineSelection(
0114 const occ::handle<SelectMgr_Selection>& aSelection);
0115
0116 void replaceWithNewLineAspect(const occ::handle<Prs3d_LineAspect>& theAspect);
0117
0118 private:
0119 occ::handle<Geom_Line> myComponent;
0120 occ::handle<Geom_Point> myStartPoint;
0121 occ::handle<Geom_Point> myEndPoint;
0122 bool myLineIsSegment;
0123 };
0124
0125 #endif