0028316: Coding Rules - Elimilate confusing aliases of Standard_Real type in V3d_View
[occt.git] / samples / mfc / standard / 07_Triangulation / src / OCCDemo_Presentation.h
CommitLineData
7fd59977 1// OCCDemo_Presentation.h: interface for the OCCDemo_Presentation class.
2// This is a base class for all presentations
3//////////////////////////////////////////////////////////////////////
4
5#if !defined(AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)
6#define AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_
7
8#if _MSC_VER > 1000
9#pragma once
10#endif // _MSC_VER > 1000
11
12
13#define WAIT_A_LITTLE WaitForInput(500)
14#define WAIT_A_SECOND WaitForInput(1000)
15
16//#include "TriangulationDoc.h"
17//#include <OCCDemo.h>
18class CTriangulationDoc;
9e3ca93a 19#include <AIS_InteractiveObject.hxx>
20#include <AIS_Point.hxx>
21#include <Geom_Surface.hxx>
22#include <Geom_Curve.hxx>
23#include <Geom2d_Curve.hxx>
7fd59977 24class Quantity_Color;
25
26class OCCDemo_Presentation
27{
28public:
29 // Construction
30 OCCDemo_Presentation() : myIndex(0), myNbSamples(0), FitMode(false){}
31 virtual ~OCCDemo_Presentation() {}
32
33public:
34 static OCCDemo_Presentation* Current;
35 // this pointer must be initialized when realize a derivable class;
36 // it is used by application to access to a presentation class instance
37
38 void SetDocument (CTriangulationDoc* theDoc) {myDoc = theDoc;}
39 // document must be set by the user of this class before first use of iterations
40 CTriangulationDoc* GetDocument () {return myDoc;}
41
42public:
43 // Titling
44 const CString& GetName() const {return myName;}
45
46public:
47 // Iteration on samples
48 void FirstSample() {myIndex=0;}
49 void LastSample() {myIndex=myNbSamples-1;}
50 Standard_Boolean AtFirstSample() const {return myIndex <= 0;}
51 Standard_Boolean AtLastSample() const {return myIndex >= myNbSamples-1;}
52 void NextSample() {myIndex++;}
53 void PrevSample() {myIndex--;}
54 virtual void DoSample() = 0;
55/*
ee2be2a8 56 static void GetViewCenter(Standard_Real& Xc, Standard_Real& Yc);
57 static void SetViewCenter(const Standard_Real Xc, const Standard_Real Yc);
58 static void GetViewEye(Standard_Real& X, Standard_Real& Y, Standard_Real& Z);
59 static void SetViewEye(Standard_Real X, Standard_Real Y, Standard_Real Z);
60 static Standard_Real GetViewScale();
61 static void SetViewScale(Standard_Real Coef);
7fd59977 62 static void ResetView();
63*/
64
65 // place one-time initialization code in this function
66 virtual void Init() {}
67
68protected:
69 // Methods to call from a derivable class
70 void setName (const char* theName) {myName = CString(theName);}
92efcf78 71 Handle(AIS_InteractiveContext) getAISContext() const;
72 Handle(V3d_Viewer) getViewer() const;
7fd59977 73 Standard_CString GetDataDir();
74
75 Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
76 // Waits for a user input or a period of time has been elapsed
77
92efcf78 78 Handle(AIS_InteractiveObject) drawSurface (const Handle(Geom_Surface)& theSurface,
7fd59977 79 const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_LEMONCHIFFON3),
80 const Standard_Boolean toDisplay = Standard_True);
81 // creates a finite face based on the given geometric surface
82 // and displays it in the viewer if toDisplay = Standard_True
83
92efcf78 84 Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom_Curve)& theCurve,
7fd59977 85 const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
86 const Standard_Boolean toDisplay = Standard_True);
87 // creates an ISession_Curve based on the given geometric curve
88 // and displays it in the viewer if toDisplay = Standard_True
89
92efcf78 90 Handle(AIS_InteractiveObject) drawCurve (const Handle(Geom2d_Curve)& theCurve,
7fd59977 91 const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_RED),
92 const Standard_Boolean toDisplay = Standard_True,
93 const gp_Ax2& aPosition = gp::XOY());
94 // converts a given curve to 3d using aPosition and calls the previous method
95
92efcf78 96 Handle(AIS_Point) drawPoint (const gp_Pnt& thePnt,
7fd59977 97 const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
98 const Standard_Boolean toDisplay = Standard_True);
99 // creates a presentation of the given point
100 // and displays it in the viewer if toDisplay = Standard_True
101
92efcf78 102 Handle(AIS_InteractiveObject) drawVector (const gp_Pnt& thePnt,
7fd59977 103 const gp_Vec& theVec,
104 const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_YELLOW),
105 const Standard_Boolean toDisplay = Standard_True);
106 // creates a presentation of the given vector
107 // and displays it in the viewer if toDisplay = Standard_True
108
92efcf78 109 Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
7fd59977 110 const Quantity_Color& theColor,
111 const Standard_Boolean toDisplay = Standard_True);
112 // creates a presentation of the given shape
113 // with material PLASTIC and a given color
114 // and displays it in the viewer if toDisplay = Standard_True
115
92efcf78 116 Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
7fd59977 117 const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
118 const Standard_Boolean toDisplay = Standard_True);
119 // creates a presentation of the given shape with the given material
120 // (color is default for a given material)
121 // and displays it in the viewer if toDisplay = Standard_True
122
123protected:
124 // Fields to use in a derivable class
125 BOOL FitMode;
126 int myIndex;
127 int myNbSamples;
128
129private:
130 CTriangulationDoc* myDoc;
131 CString myName;
132
133};
134
135#endif // !defined(AFX_OCCDEMO_PRESENTATION_H__790EED7F_7BA2_11D5_BA4A_0060B0EE18EA__INCLUDED_)