e511d7d449ecf70f332c19219659a65f35b97dec
[occt.git] / samples / mfc / standard / Common / Primitive / Sample2D_Face.h
1 #ifndef _Sample2D_Face_HeaderFile
2 #define _Sample2D_Face_HeaderFile
3
4 #include <Standard_Macro.hxx>
5 #include <Standard_DefineHandle.hxx>
6 #include "TopoDS_Face.hxx"
7 #include <TColGeom_SequenceOfCurve.hxx>
8 #include <Graphic3d_ArrayOfPolylines.hxx>
9
10 #include <Standard_Macro.hxx>
11 class Sample2D_Face;
12 DEFINE_STANDARD_HANDLE(Sample2D_Face,AIS_InteractiveObject)
13 class Sample2D_Face : public AIS_InteractiveObject {
14
15
16
17
18 public:
19
20  // Methods PUBLIC
21  // 
22 Standard_EXPORT Sample2D_Face (const TopoDS_Shape& theFace);
23
24 DEFINE_STANDARD_RTTIEXT(Sample2D_Face,AIS_InteractiveObject)
25
26 private:
27
28 //private fields
29   TopoDS_Shape myshape;
30   TColGeom_SequenceOfCurve mySeq_FORWARD;
31   TColGeom_SequenceOfCurve mySeq_REVERSED;
32   TColGeom_SequenceOfCurve mySeq_INTERNAL;
33   TColGeom_SequenceOfCurve mySeq_EXTERNAL;
34
35   Handle(Graphic3d_ArrayOfPolylines) myForwardArray;
36   Handle(Graphic3d_ArrayOfPolylines) myReversedArray;
37   Handle(Graphic3d_ArrayOfPolylines) myInternalArray;
38   Handle(Graphic3d_ArrayOfPolylines) myExternalArray;
39
40   Standard_Integer myForwardNum,
41                     myReversedNum,
42                     myInternalNum,
43                     myExternalNum,
44                     myForwardBounds,
45                     myReversedBounds,
46                     myInternalBounds,
47                     myExternalBounds;
48
49 //private methods
50   void FillData(Standard_Boolean isSizesRecomputed = Standard_False); 
51   void ClearSelected ();
52   void HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePM,
53                         const SelectMgr_SequenceOfOwner& theOwners);
54
55   void HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
56                               const Quantity_NameOfColor theColor,
57                               const Handle(SelectMgr_EntityOwner)& theOwner);
58
59   void Compute (  const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
60                   const Handle(Prs3d_Presentation)& thePresentation,
61                   const Standard_Integer theMode);
62
63   void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
64     const Standard_Integer theMode);
65
66   void DrawMarker(const Handle(Geom2d_TrimmedCurve)& theCurve, const Handle(Prs3d_Presentation)& thePresentation);
67
68 public:
69   Quantity_Color myFORWARDColor;
70   Quantity_Color myREVERSEDColor;
71   Quantity_Color myINTERNALColor;
72   Quantity_Color myEXTERNALColor;
73   Standard_Integer myWidthIndex;
74   Standard_Integer myTypeIndex ;
75
76   TopoDS_Shape& Shape(){return myshape;}
77   void SetFace (const TopoDS_Shape& theFace){myshape = theFace;}
78
79 };
80
81 #endif