1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0023776: Redesign of MFC samples after V2d viewer removing

This commit is contained in:
aba
2013-03-12 09:19:35 +04:00
parent fad8962a72
commit 5c1f974e17
212 changed files with 9053 additions and 19513 deletions

View File

@@ -12,9 +12,9 @@
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
//{{AFX_MSG_MAP(CChildFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -22,8 +22,8 @@ END_MESSAGE_MAP()
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
@@ -36,61 +36,59 @@ CChildFrame::~CChildFrame()
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
static BOOL first=true;
if(first){
first=false;
CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);
return;
}
/*
POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition();
CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos);
POSITION p=DocT->GetFirstDocPosition();
DocT->GetNextDoc(p);
if(p==NULL)
nCmdShow = SW_SHOWMAXIMIZED;
*/
CMDIChildWnd::ActivateFrame(nCmdShow);
// TODO: Add your specialized code here and/or call the base class
static BOOL first=true;
if(first){
first=false;
CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);
return;
}
/*
POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition();
CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos);
POSITION p=DocT->GetFirstDocPosition();
DocT->GetNextDoc(p);
if(p==NULL)
nCmdShow = SW_SHOWMAXIMIZED;
*/
CMDIChildWnd::ActivateFrame(nCmdShow);
}
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_3dCHILDFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_3dCHILDFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
return 0;
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CChildFrame::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
return CMDIChildWnd::DestroyWindow();
// TODO: Add your specialized code here and/or call the base class
return CMDIChildWnd::DestroyWindow();
}

View File

@@ -8,32 +8,32 @@
class CChildFrame : public OCC_BaseChildFrame
{
DECLARE_DYNCREATE(CChildFrame)
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
CChildFrame();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
public:
virtual void ActivateFrame(int nCmdShow = -1);
virtual BOOL DestroyWindow();
//}}AFX_VIRTUAL
// Implementation
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
public:
virtual ~CChildFrame();
virtual void ActivateFrame(int nCmdShow = -1);
virtual BOOL DestroyWindow();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
// Generated message map functions
protected:
//{{AFX_MSG(CChildFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CChildFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1,25 +1,23 @@
// ChildFrm2D.cpp : implementation of the CChildFrame2D class/
#include "stdafx.h"
#include "ChildFrm2d.h"
#include "GeometryApp.h"
IMPLEMENT_DYNCREATE(CChildFrame2D, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame2D, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame2D)
ON_WM_CREATE()
//}}AFX_MSG_MAP
//{{AFX_MSG_MAP(CChildFrame2D)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
@@ -28,8 +26,8 @@ static UINT indicators[] =
CChildFrame2D::CChildFrame2D()
{
// TODO: add member initialization code here
// TODO: add member initialization code here
}
CChildFrame2D::~CChildFrame2D()
@@ -42,12 +40,12 @@ CChildFrame2D::~CChildFrame2D()
#ifdef _DEBUG
void CChildFrame2D::AssertValid() const
{
CMDIChildWnd::AssertValid();
CMDIChildWnd::AssertValid();
}
void CChildFrame2D::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
@@ -57,35 +55,35 @@ void CChildFrame2D::Dump(CDumpContext& dc) const
int CChildFrame2D::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_2dCHILDFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_2dCHILDFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
void CChildFrame2D::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
CMDIChildWnd::ActivateFrame(nCmdShow);
// TODO: Add your specialized code here and/or call the base class
CMDIChildWnd::ActivateFrame(nCmdShow);
}

View File

@@ -8,38 +8,38 @@
class CChildFrame2D : public OCC_BaseChildFrame
{
DECLARE_DYNCREATE(CChildFrame2D)
DECLARE_DYNCREATE(CChildFrame2D)
public:
CChildFrame2D();
CChildFrame2D();
// Attributes
// Attributes
public:
// Operations
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame2D)
public:
virtual void ActivateFrame(int nCmdShow = -1);
//}}AFX_VIRTUAL
// Implementation
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame2D)
public:
virtual ~CChildFrame2D();
virtual void ActivateFrame(int nCmdShow = -1);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildFrame2D();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
// Generated message map functions
protected:
//CToolBar m_wndToolBar;
//{{AFX_MSG(CChildFrame2D)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//CToolBar m_wndToolBar;
//{{AFX_MSG(CChildFrame2D)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

View File

@@ -34,7 +34,7 @@
//=============================================================================
GeoAlgo_Sol::GeoAlgo_Sol():myIsDone(Standard_False)
{
}
@@ -115,7 +115,6 @@ void GeoAlgo_Sol::Build(const TColgp_SequenceOfXYZ& seqOfXYZ)
//=============================================================================
Handle(Geom_BSplineSurface) GeoAlgo_Sol::Surface() const
{
return myGround;
}
@@ -139,15 +138,15 @@ Standard_Boolean GeoAlgo_Sol::IsDone() const
//=============================================================================
Handle(Geom_BSplineSurface) GeoAlgo_Sol::Read(const Standard_CString aGroundName)
{
// This methods read a file of points ans build a surface using plate algorithm
// This methods read a file of points ans build a surface using plate algorithm
myIsDone = Standard_True;
Standard_Integer nbPnt=0;
// Read points from the file
// Read points from the file
filebuf fic;
istream in(&fic);
if (!fic.open(aGroundName,ios::in)){
cout << " impossible to open a file : "<<aGroundName<<endl;
myIsDone = Standard_False;
@@ -159,9 +158,9 @@ Handle(Geom_BSplineSurface) GeoAlgo_Sol::Read(const Standard_CString aGroundName
Standard_Real x,y,z;
while (!in.fail()|| !in.eof()){
if (in >> x && in >> y && in >> z){
pntXYZ.SetX(x);
pntXYZ.SetY(y);
pntXYZ.SetZ(z);
pntXYZ.SetX(x);
pntXYZ.SetY(y);
pntXYZ.SetZ(z);
nbPnt++;
seqOfXYZ.Append(pntXYZ);
}
@@ -169,12 +168,4 @@ Handle(Geom_BSplineSurface) GeoAlgo_Sol::Read(const Standard_CString aGroundName
fic.close();
Build(seqOfXYZ);
return myGround;
}

View File

@@ -33,32 +33,19 @@ class Geom_BSplineSurface;
#include <Standard_Macro.hxx>
#endif
class GeoAlgo_Sol {
class GeoAlgo_Sol
{
public:
// Methods PUBLIC
//
Standard_EXPORT GeoAlgo_Sol();
Standard_EXPORT GeoAlgo_Sol(const Standard_CString aGroundName);
Standard_EXPORT void Build(const Standard_CString aGroundName) ;
Standard_EXPORT void Build(const TColgp_SequenceOfXYZ& aSeqofPoints) ;
Standard_EXPORT Handle_Geom_BSplineSurface Surface() const;
Standard_EXPORT Standard_Boolean IsDone() const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
Standard_EXPORT GeoAlgo_Sol();
Standard_EXPORT GeoAlgo_Sol(const Standard_CString aGroundName);
Standard_EXPORT void Build(const Standard_CString aGroundName) ;
Standard_EXPORT void Build(const TColgp_SequenceOfXYZ& aSeqofPoints) ;
Standard_EXPORT Handle_Geom_BSplineSurface Surface() const;
Standard_EXPORT Standard_Boolean IsDone() const;
private:
@@ -66,14 +53,11 @@ private:
//
Standard_EXPORT Handle_Geom_BSplineSurface Read(const Standard_CString aGroundName) ;
// Fields PRIVATE
//
Handle_Geom_BSplineSurface myGround;
Standard_Boolean myIsDone;
};

File diff suppressed because it is too large Load Diff

View File

@@ -16,110 +16,110 @@
class GeomSources
{
public:
Standard_EXPORT static void gpTest1(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest2(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest3(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest4(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest5(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest6(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest7(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest8(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest9(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest10(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest11(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest12(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest13(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest14(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest15(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest16(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest17(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest18(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest19(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest20(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest21(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest22(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest23(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest24(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest25(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest26(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest27(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest28(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest29(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest30(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest31(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest32(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest33(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest34(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest35(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest36(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest37(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest38(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest39(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest40(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest41(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest42(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest43(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest44(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest45(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest46(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest47(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest48(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest49(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest50(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest51(CGeometryDoc* aDoc);
GeomSources();
virtual ~GeomSources();
Standard_EXPORT static void gpTest1(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest2(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest3(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest4(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest5(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest6(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest7(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest8(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest9(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest10(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest11(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest12(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest13(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest14(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest15(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest16(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest17(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest18(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest19(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest20(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest21(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest22(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest23(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest24(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest25(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest26(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest27(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest28(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest29(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest30(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest31(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest32(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest33(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest34(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest35(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest36(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest37(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest38(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest39(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest40(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest41(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest42(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest43(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest44(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest45(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest46(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest47(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest48(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest49(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest50(CGeometryDoc* aDoc);
Standard_EXPORT static void gpTest51(CGeometryDoc* aDoc);
GeomSources();
virtual ~GeomSources();
private:
enum DisplayType{No2DNo3D, // 0 0 0
No2D3D , // 0 0 1
a2DNo3D , // 0 1 0
a2D3D }; // 1 1 1
No2D3D , // 0 0 1
a2DNo3D , // 0 1 0
a2D3D }; // 1 1 1
static void PreProcess (CGeometryDoc* aDoc,DisplayType aDisplayType);
static void PostProcess(CGeometryDoc* aDoc,UINT anID,DisplayType aDisplayType,const char* aString="",Quantity_Coefficient Coef = -1/*double zoom =-1*/);
static void DisplayPoint(CGeometryDoc* aDoc,
gp_Pnt2d& aPoint,
const char* aText,
Standard_Boolean UpdateViewer = Standard_False,
Standard_Real anXoffset =0,
Standard_Real anYoffset =0,
Standard_Real TextScale = 0.05);
gp_Pnt2d& aPoint,
const char* aText,
Standard_Boolean UpdateViewer = Standard_False,
Standard_Real anXoffset =0,
Standard_Real anYoffset =0,
Standard_Real TextScale = 0.05);
static void DisplayPoint(CGeometryDoc* aDoc,
gp_Pnt& aPoint,
const char* aText,
Standard_Boolean UpdateViewer = Standard_False,
Standard_Real anXoffset = 0,
Standard_Real anYoffset = 0,
Standard_Real aZoffset = 0,
Standard_Real TextScale = 0.05);
gp_Pnt& aPoint,
const char* aText,
Standard_Boolean UpdateViewer = Standard_False,
Standard_Real anXoffset = 0,
Standard_Real anYoffset = 0,
Standard_Real aZoffset = 0,
Standard_Real TextScale = 0.05);
static void DisplayCurve(CGeometryDoc* aDoc,
Handle(Geom2d_Curve) aCurve,
Standard_Integer aColorIndex = 4,
Standard_Boolean UpdateViewer = false);
static void DisplayCurveAndCurvature(CGeometryDoc* aDoc,
Handle(Geom2d_Curve) aCurve,
Standard_Integer aColorIndex = 4,
Standard_Boolean UpdateViewer = false);
static void DisplayCurve(CGeometryDoc* aDoc,
Handle(Geom2d_Curve) aCurve,
Standard_Integer aColorIndex = 4,
Standard_Boolean UpdateViewer = false);
static void DisplayCurveAndCurvature(CGeometryDoc* aDoc,
Handle(Geom2d_Curve) aCurve,
Standard_Integer aColorIndex = 4,
Standard_Boolean UpdateViewer = false);
static void DisplayCurve(CGeometryDoc* aDoc,
Handle(Geom_Curve) aCurve,
Quantity_NameOfColor aNameOfColor,
Standard_Boolean UpdateViewer = false);
static void DisplayCurve(CGeometryDoc* aDoc,
Handle(Geom_Curve) aCurve,
Quantity_NameOfColor aNameOfColor,
Standard_Boolean UpdateViewer = false);
static void DisplayCurve(CGeometryDoc* aDoc,
Handle(Geom_Curve) aCurve,
Standard_Boolean UpdateViewer = false);
static void DisplayCurve(CGeometryDoc* aDoc,
Handle(Geom_Curve) aCurve,
Standard_Boolean UpdateViewer = false);
static void DisplaySurface (CGeometryDoc* aDoc,
Handle(Geom_Surface) aSurface,
Quantity_NameOfColor aNameOfColor,
Standard_Boolean UpdateViewer = false);
static void DisplaySurface (CGeometryDoc* aDoc,
Handle(Geom_Surface) aSurface,
Quantity_NameOfColor aNameOfColor,
Standard_Boolean UpdateViewer = false);
static void DisplaySurface (CGeometryDoc* aDoc,
Handle(Geom_Surface) aSurface,
Standard_Boolean UpdateViewer = false);
static void DisplaySurface (CGeometryDoc* aDoc,
Handle(Geom_Surface) aSurface,
Standard_Boolean UpdateViewer = false);

View File

@@ -15,15 +15,14 @@
/////////////////////////////////////////////////////////////////////////////
// CGeometryApp construction
CGeometryApp::CGeometryApp()
CGeometryApp::CGeometryApp() : OCC_App()
{
SampleName = "Geometry"; //for about dialog
SampleName = "Geometry"; //for about dialog
}
CGeometryApp::~CGeometryApp()
{
delete pDocTemplateForView2d;
delete pDocTemplateForView2d;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CGeometryApp object
@@ -35,58 +34,57 @@ CGeometryApp theApp;
BOOL CGeometryApp::InitInstance()
{
AfxInitRichEdit();
AfxEnableControlContainer();
AfxInitRichEdit();
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
// Change the registry key under which our settings are stored.
// You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
// Change the registry key under which our settings are stored.
// You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
pDocTemplateForView3d = new CMultiDocTemplate(
IDR_3DTYPE,
RUNTIME_CLASS(CGeometryDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CGeometryView));
AddDocTemplate(pDocTemplateForView3d);
pDocTemplateForView2d = new CMultiDocTemplate(
IDR_2DTYPE,
RUNTIME_CLASS(CGeometryDoc),
RUNTIME_CLASS(CChildFrame2D), // custom MDI child frame
RUNTIME_CLASS(CGeometryView2D));
//AddDocTemplate(pDocTemplateForView2d);
pDocTemplateForView3d = new CMultiDocTemplate(
IDR_3DTYPE,
RUNTIME_CLASS(CGeometryDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CGeometryView));
AddDocTemplate(pDocTemplateForView3d);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
pDocTemplateForView2d = new CMultiDocTemplate(
IDR_2DTYPE,
RUNTIME_CLASS(CGeometryDoc),
RUNTIME_CLASS(CChildFrame2D), // custom MDI child frame
RUNTIME_CLASS(CGeometryView2D));
//AddDocTemplate(pDocTemplateForView2d);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
@@ -117,10 +115,10 @@ BOOL CGeometryApp::IsViewExisting(CDocument * pDoc, CRuntimeClass * pViewClass,
CView* pCurrentView = pDoc->GetNextView(position);
ASSERT_VALID(pCurrentView);
if (pCurrentView->IsKindOf(pViewClass))
{
{
pView = pCurrentView;
return TRUE;
}
return TRUE;
}
}
return FALSE;
}

View File

@@ -8,29 +8,29 @@
#pragma once
#endif // _MSC_VER >= 1000
#include <OCC_3dApp.h>
#include <OCC_App.h>
#include <GeometryDoc.h>
class CGeometryApp : public OCC_3dApp
class CGeometryApp : public OCC_App
{
public:
CGeometryApp();
~CGeometryApp();
// =========================================
CFrameWnd* CreateView2D(CGeometryDoc* pDoc);
// =========================================
// =========================================
CGeometryApp();
~CGeometryApp();
// =========================================
CFrameWnd* CreateView2D(CGeometryDoc* pDoc);
// =========================================
// =========================================
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeometryApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeometryApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
private :
BOOL IsViewExisting(CDocument* pDoc,CRuntimeClass* pViewClass,CView*& pView);
CMultiDocTemplate* pDocTemplateForView3d;
CMultiDocTemplate* pDocTemplateForView2d;
BOOL IsViewExisting(CDocument* pDoc,CRuntimeClass* pViewClass,CView*& pView);
CMultiDocTemplate* pDocTemplateForView3d;
CMultiDocTemplate* pDocTemplateForView2d;
};

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,6 @@
#pragma once
#endif // _MSC_VER >= 1000
#include "ISession2D_InteractiveContext.h"
#include "ResultDialog.h"
class Handle_AIS_Point;
@@ -17,225 +16,224 @@ class Handle_AIS_Point;
class CGeometryDoc : public CDocument
{
public:
void Put2DOnTop(bool isMax = true);
void Put3DOnTop(bool isMax = true);
void Fit2DViews();
void Set3DViewsZoom(const Quantity_Factor& Coef );
void Fit3DViews(Quantity_Coefficient Coef);
void simplify(const TopoDS_Shape& aShape);
void Put2DOnTop(bool isMax = true);
void Put3DOnTop(bool isMax = true);
void Fit2DViews();
void Set3DViewsZoom(const Quantity_Factor& Coef );
void Fit3DViews(Quantity_Coefficient Coef);
void simplify(const TopoDS_Shape& aShape);
static void Fit();
static void Fit();
// 2D
// 2D
void DragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle_V3d_View& aView );
void InputEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
void MoveEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
void ShiftMoveEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
void ShiftDragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle_V3d_View& aView );
void ShiftInputEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
void Popup2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V3d_View& aView );
void DragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle_V2d_View& aView );
void InputEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V2d_View& aView );
void MoveEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V2d_View& aView );
void ShiftMoveEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V2d_View& aView );
void ShiftDragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle_V2d_View& aView );
void ShiftInputEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V2d_View& aView );
void Popup2D (const Standard_Integer x ,
const Standard_Integer y ,
const Handle_V2d_View& aView );
Handle_AIS_InteractiveObject drawSurface
(const Handle_Geom_Surface& theSurface,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay);
Handle_AIS_InteractiveObject drawSurface
(const Handle_Geom_Surface& theSurface,
const Quantity_Color& theColor,
const Standard_Boolean toDisplay);
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
// Waits for a user input or a period of time has been elapsed
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
// Waits for a user input or a period of time has been elapsed
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given point
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given point
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
// and displays it in the viewer if toDisplay = Standard_True
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
// and displays it in the viewer if toDisplay = Standard_True
protected: // create from serialization only
CGeometryDoc();
DECLARE_DYNCREATE(CGeometryDoc)
CGeometryDoc();
DECLARE_DYNCREATE(CGeometryDoc)
// Attributes
// Attributes
public:
// Operations
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeometryDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual void OnCloseDocument();
//}}AFX_VIRTUAL
// Implementation
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeometryDoc)
public:
virtual ~CGeometryDoc();
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual void OnCloseDocument();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGeometryDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
// Generated message map functions
protected:
//{{AFX_MSG(CGeometryDoc)
afx_msg void OnWindowNew2d();
afx_msg void OnBUTTONTest1();
afx_msg void OnBUTTONTest2();
afx_msg void OnBUTTONTest3();
afx_msg void OnBUTTONTest4();
afx_msg void OnBUTTONTest5();
afx_msg void OnBUTTONTest6();
afx_msg void OnBUTTONTest7();
afx_msg void OnBUTTONTest8();
afx_msg void OnBUTTONTest9();
afx_msg void OnBUTTONTest10();
afx_msg void OnBUTTONTest11();
afx_msg void OnBUTTONTest12();
afx_msg void OnBUTTONTest13();
afx_msg void OnBUTTONTest14();
afx_msg void OnBUTTONTest15();
afx_msg void OnBUTTONTest16();
afx_msg void OnBUTTONTest17();
afx_msg void OnBUTTONTest18();
afx_msg void OnBUTTONTest19();
afx_msg void OnBUTTONTest20();
afx_msg void OnBUTTONTest21();
afx_msg void OnBUTTONTest22();
afx_msg void OnBUTTONTest23();
afx_msg void OnBUTTONTest24();
afx_msg void OnBUTTONTest25();
afx_msg void OnBUTTONTest26();
afx_msg void OnBUTTONTest27();
afx_msg void OnBUTTONTest28();
afx_msg void OnBUTTONTest29();
afx_msg void OnBUTTONTest30();
afx_msg void OnBUTTONTest31();
afx_msg void OnBUTTONTest32();
afx_msg void OnBUTTONTest33();
afx_msg void OnBUTTONTest34();
afx_msg void OnBUTTONTest35();
afx_msg void OnBUTTONTest36();
afx_msg void OnBUTTONTest37();
afx_msg void OnBUTTONTest38();
afx_msg void OnBUTTONTest39();
afx_msg void OnBUTTONTest40();
afx_msg void OnBUTTONTest41();
afx_msg void OnBUTTONTest42();
afx_msg void OnBUTTONTest43();
afx_msg void OnBUTTONTest44();
afx_msg void OnBUTTONTest45();
afx_msg void OnBUTTONTest46();
afx_msg void OnBUTTONTest47();
afx_msg void OnBUTTONTest48();
afx_msg void OnBUTTONTest49();
afx_msg void OnBUTTONTest50();
afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI);
afx_msg void OnCreateSol();
afx_msg void OnSimplify();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CGeometryDoc)
afx_msg void OnWindowNew2d();
afx_msg void OnBUTTONTest1();
afx_msg void OnBUTTONTest2();
afx_msg void OnBUTTONTest3();
afx_msg void OnBUTTONTest4();
afx_msg void OnBUTTONTest5();
afx_msg void OnBUTTONTest6();
afx_msg void OnBUTTONTest7();
afx_msg void OnBUTTONTest8();
afx_msg void OnBUTTONTest9();
afx_msg void OnBUTTONTest10();
afx_msg void OnBUTTONTest11();
afx_msg void OnBUTTONTest12();
afx_msg void OnBUTTONTest13();
afx_msg void OnBUTTONTest14();
afx_msg void OnBUTTONTest15();
afx_msg void OnBUTTONTest16();
afx_msg void OnBUTTONTest17();
afx_msg void OnBUTTONTest18();
afx_msg void OnBUTTONTest19();
afx_msg void OnBUTTONTest20();
afx_msg void OnBUTTONTest21();
afx_msg void OnBUTTONTest22();
afx_msg void OnBUTTONTest23();
afx_msg void OnBUTTONTest24();
afx_msg void OnBUTTONTest25();
afx_msg void OnBUTTONTest26();
afx_msg void OnBUTTONTest27();
afx_msg void OnBUTTONTest28();
afx_msg void OnBUTTONTest29();
afx_msg void OnBUTTONTest30();
afx_msg void OnBUTTONTest31();
afx_msg void OnBUTTONTest32();
afx_msg void OnBUTTONTest33();
afx_msg void OnBUTTONTest34();
afx_msg void OnBUTTONTest35();
afx_msg void OnBUTTONTest36();
afx_msg void OnBUTTONTest37();
afx_msg void OnBUTTONTest38();
afx_msg void OnBUTTONTest39();
afx_msg void OnBUTTONTest40();
afx_msg void OnBUTTONTest41();
afx_msg void OnBUTTONTest42();
afx_msg void OnBUTTONTest43();
afx_msg void OnBUTTONTest44();
afx_msg void OnBUTTONTest45();
afx_msg void OnBUTTONTest46();
afx_msg void OnBUTTONTest47();
afx_msg void OnBUTTONTest48();
afx_msg void OnBUTTONTest49();
afx_msg void OnBUTTONTest50();
afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI);
afx_msg void OnCreateSol();
afx_msg void OnSimplify();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Handle_V3d_Viewer myViewer;
Handle_V3d_Viewer myViewerCollector;
Handle_AIS_InteractiveContext myAISContext;
Handle_V3d_Viewer myViewer;
Handle_V3d_Viewer myViewerCollector;
Handle_AIS_InteractiveContext myAISContext;
public :
Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; };
Handle_V3d_Viewer GetViewer() { return myViewer; };
Handle_V3d_Viewer GetViewerCollector() { return myViewerCollector; };
Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; };
Handle_V3d_Viewer GetViewer() { return myViewer; };
Handle_V3d_Viewer GetViewerCollector() { return myViewerCollector; };
private:
Handle_V2d_Viewer myViewer2D;
Handle_ISession2D_InteractiveContext myISessionContext;
Handle_V3d_Viewer myViewer2D;
Handle_AIS_InteractiveContext myAISContext2D;
public :
int Current;
void Minimize3D();
void Minimize2D();
Handle_V2d_Viewer GetViewer2D() { return myViewer2D; };
Handle_ISession2D_InteractiveContext& GetISessionContext(){ return myISessionContext; };
BOOL FitMode;
int Current;
void Minimize3D();
void Minimize2D();
Handle_V3d_Viewer GetViewer2D() { return myViewer2D; };
Handle_AIS_InteractiveContext& GetISessionContext(){ return myAISContext2D; };
BOOL FitMode;
public :
CResultDialog myCResultDialog;
CResultDialog myCResultDialog;
};

View File

@@ -21,24 +21,24 @@ static char THIS_FILE[] = __FILE__;
IMPLEMENT_DYNCREATE(CGeometryView, OCC_3dView)
BEGIN_MESSAGE_MAP(CGeometryView, OCC_3dView)
//{{AFX_MSG_MAP(CGeometryView)
ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage)
ON_WM_SIZE()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MBUTTONDOWN()
ON_WM_MBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOff, OnUpdateBUTTONHlrOff)
ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOn, OnUpdateBUTTONHlrOn)
ON_UPDATE_COMMAND_UI(ID_BUTTONPanGlo, OnUpdateBUTTONPanGlo)
ON_UPDATE_COMMAND_UI(ID_BUTTONPan, OnUpdateBUTTONPan)
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomProg, OnUpdateBUTTONZoomProg)
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomWin, OnUpdateBUTTONZoomWin)
ON_UPDATE_COMMAND_UI(ID_BUTTONRot, OnUpdateBUTTONRot)
//}}AFX_MSG_MAP
//{{AFX_MSG_MAP(CGeometryView)
ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage)
ON_WM_SIZE()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MBUTTONDOWN()
ON_WM_MBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOff, OnUpdateBUTTONHlrOff)
ON_UPDATE_COMMAND_UI(ID_BUTTONHlrOn, OnUpdateBUTTONHlrOn)
ON_UPDATE_COMMAND_UI(ID_BUTTONPanGlo, OnUpdateBUTTONPanGlo)
ON_UPDATE_COMMAND_UI(ID_BUTTONPan, OnUpdateBUTTONPan)
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomProg, OnUpdateBUTTONZoomProg)
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomWin, OnUpdateBUTTONZoomWin)
ON_UPDATE_COMMAND_UI(ID_BUTTONRot, OnUpdateBUTTONRot)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -58,18 +58,18 @@ CGeometryView::~CGeometryView()
#ifdef _DEBUG
void CGeometryView::AssertValid() const
{
CView::AssertValid();
CView::AssertValid();
}
void CGeometryView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
CView::Dump(dc);
}
CGeometryDoc* CGeometryView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc)));
return (CGeometryDoc*)m_pDocument;
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc)));
return (CGeometryDoc*)m_pDocument;
}
#endif //_DEBUG
@@ -79,25 +79,29 @@ CGeometryDoc* CGeometryView::GetDocument() // non-debug version is inline
void CGeometryView::OnFileExportImage()
{
CFileDialog dlg(FALSE,_T("*.BMP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("BMP Files (*.BMP)|*.bmp |GIF Files (*.GIF)|*.gif | PNG Files (*.PNG)|*.png"
"|JPEG Files (*.JPEG)|*.jpeg | PPM Files (*.PPM)|*.ppm | TIFF Files (*.TIFF)"
"|*.tiff | TGA Files (*.TGA)|*.tga | EXR Files (*.EXR)|*.exr||"),
NULL );
if (dlg.DoModal() == IDOK)
CFileDialog aDlg (FALSE, "*.BMP", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"BMP Files (*.BMP)|*.bmp|"
"GIF Files (*.GIF)|*.gif|"
"PNG Files (*.PNG)|*.png|"
"JPEG Files (*.JPG)|*.jpg|"
"PPM Files (*.PPM)|*.ppm|"
"TIFF Files (*.TIFF)|*.tiff|"
"TGA Files (*.TGA)|*.tga|"
"EXR Files (*.EXR)|*.exr||", NULL);
if (aDlg.DoModal() != IDOK)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
CString aFileName = dlg.GetPathName();
myView->Dump(aFileName);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
return;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->Dump (aDlg.GetPathName());
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
void CGeometryView::OnSize(UINT nType, int cx, int cy)
{
if (!myView.IsNull())
myView->MustBeResized();
myView->MustBeResized();
}
void CGeometryView::OnLButtonDown(UINT nFlags, CPoint point)
@@ -107,277 +111,277 @@ void CGeometryView::OnLButtonDown(UINT nFlags, CPoint point)
myXmax=point.x; myYmax=point.y;
if ( nFlags & MK_CONTROL )
{
// Button MB1 down Control :start zomming
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing : // start a drag
if (nFlags & MK_SHIFT)
ShiftDragEvent(myXmax,myYmax,-1);
else
DragEvent(myXmax,myYmax,-1);
break;
break;
case CurAction3d_DynamicZooming : // noting
// SetCursor(AfxGetApp()->LoadStandardCursor());
break;
case CurAction3d_WindowZooming :
break;
case CurAction3d_DynamicPanning :// noting
// SetCursor(AfxGetApp()->LoadStandardCursor());
break;
case CurAction3d_GlobalPanning :// noting
// SetCursor(AfxGetApp()->LoadStandardCursor());
break;
case CurAction3d_DynamicRotation :
// SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn)
myView->SetDegenerateModeOn();
myView->StartRotation(point.x,point.y);
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}
{
// Button MB1 down Control :start zomming
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing : // start a drag
if (nFlags & MK_SHIFT)
ShiftDragEvent(myXmax,myYmax,-1);
else
DragEvent(myXmax,myYmax,-1);
break;
break;
case CurAction3d_DynamicZooming : // noting
// SetCursor(AfxGetApp()->LoadStandardCursor());
break;
case CurAction3d_WindowZooming :
break;
case CurAction3d_DynamicPanning :// noting
// SetCursor(AfxGetApp()->LoadStandardCursor());
break;
case CurAction3d_GlobalPanning :// noting
// SetCursor(AfxGetApp()->LoadStandardCursor());
break;
case CurAction3d_DynamicRotation :
// SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn)
myView->SetDegenerateModeOn();
myView->StartRotation(point.x,point.y);
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}
}
}
void CGeometryView::OnLButtonUp(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
return;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
if (point.x == myXmin && point.y == myYmin)
{ // no offset between down and up --> selectEvent
myXmax=point.x;
myYmax=point.y;
if (nFlags & MK_SHIFT )
ShiftInputEvent(point.x,point.y);
else
InputEvent (point.x,point.y);
} else
{
myXmax=point.x; myYmax=point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
if (nFlags & MK_SHIFT)
ShiftDragEvent(point.x,point.y,1);
else
DragEvent(point.x,point.y,1);
}
break;
case CurAction3d_DynamicZooming :
// SetCursor(AfxGetApp()->LoadStandardCursor());
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_WindowZooming :
myXmax=point.x; myYmax=point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
// Test if the zoom window is greater than a minimale window.
{
// Do the zoom window between Pmin and Pmax
myView->WindowFitAll(myXmin,myYmin,myXmax,myYmax);
}
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_DynamicPanning :
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_GlobalPanning :
myView->Place(point.x,point.y,myCurZoom);
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_DynamicRotation :
myCurrentMode = CurAction3d_Nothing;
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
if ( nFlags & MK_CONTROL )
{
return;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
if (point.x == myXmin && point.y == myYmin)
{ // no offset between down and up --> selectEvent
myXmax=point.x;
myYmax=point.y;
if (nFlags & MK_SHIFT )
ShiftInputEvent(point.x,point.y);
else
InputEvent (point.x,point.y);
} else
{
myXmax=point.x; myYmax=point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
if (nFlags & MK_SHIFT)
ShiftDragEvent(point.x,point.y,1);
else
DragEvent(point.x,point.y,1);
}
break;
case CurAction3d_DynamicZooming :
// SetCursor(AfxGetApp()->LoadStandardCursor());
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_WindowZooming :
myXmax=point.x; myYmax=point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
// Test if the zoom window is greater than a minimale window.
{
// Do the zoom window between Pmin and Pmax
myView->WindowFitAll(myXmin,myYmin,myXmax,myYmax);
}
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_DynamicPanning :
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_GlobalPanning :
myView->Place(point.x,point.y,myCurZoom);
myCurrentMode = CurAction3d_Nothing;
break;
case CurAction3d_DynamicRotation :
myCurrentMode = CurAction3d_Nothing;
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
}
void CGeometryView::OnMButtonDown(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
// Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
if ( nFlags & MK_CONTROL )
{
// Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
}
void CGeometryView::OnMButtonUp(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
// Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
if ( nFlags & MK_CONTROL )
{
// Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
}
void CGeometryView::OnRButtonDown(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
// SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn)
myView->SetDegenerateModeOn();
myView->StartRotation(point.x,point.y);
}
else // if ( Ctrl )
{
Popup(point.x,point.y);
}
if ( nFlags & MK_CONTROL )
{
// SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn)
myView->SetDegenerateModeOn();
myView->StartRotation(point.x,point.y);
}
else // if ( Ctrl )
{
Popup(point.x,point.y);
}
}
void CGeometryView::OnRButtonUp(UINT nFlags, CPoint point)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
if (!myDegenerateModeIsOn)
{
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
} else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
if (!myDegenerateModeIsOn)
{
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
} else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
void CGeometryView::OnMouseMove(UINT nFlags, CPoint point)
{
// ============================ LEFT BUTTON =======================
// ============================ LEFT BUTTON =======================
if ( nFlags & MK_LBUTTON)
{
if ( nFlags & MK_CONTROL )
{
if ( nFlags & MK_CONTROL )
{
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min
myXmax = point.x;
myYmax = point.y;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax = point.x;
myYmax = point.y;
if (nFlags & MK_SHIFT)
ShiftDragEvent(myXmax,myYmax,0);
else
DragEvent(myXmax,myYmax,0);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True);
break;
case CurAction3d_DynamicZooming :
myView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min \n";
myXmax=point.x; myYmax=point.y;
break;
case CurAction3d_WindowZooming :
myXmax = point.x; myYmax = point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
break;
case CurAction3d_DynamicPanning :
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
break;
case CurAction3d_GlobalPanning : // nothing
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min
myXmax = point.x;
myYmax = point.y;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax = point.x;
myYmax = point.y;
if (nFlags & MK_SHIFT)
ShiftDragEvent(myXmax,myYmax,0);
else
DragEvent(myXmax,myYmax,0);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True);
break;
case CurAction3d_DynamicRotation :
myView->Rotation(point.x,point.y);
myView->Redraw();
case CurAction3d_DynamicZooming :
myView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min \n";
myXmax=point.x; myYmax=point.y;
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
case CurAction3d_WindowZooming :
myXmax = point.x; myYmax = point.y;
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
} else // if ( nFlags & MK_LBUTTON)
case CurAction3d_DynamicPanning :
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
break;
case CurAction3d_GlobalPanning : // nothing
break;
case CurAction3d_DynamicRotation :
myView->Rotation(point.x,point.y);
myView->Redraw();
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
} else // if ( nFlags & MK_LBUTTON)
// ============================ MIDDLE BUTTON =======================
if ( nFlags & MK_MBUTTON)
{
if ( nFlags & MK_CONTROL )
{
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
if ( nFlags & MK_CONTROL )
{
myView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
}
}
} else // if ( nFlags & MK_MBUTTON)
// ============================ RIGHT BUTTON =======================
if ( nFlags & MK_RBUTTON)
{
if ( nFlags & MK_CONTROL )
{
myView->Rotation(point.x,point.y);
}
}else //if ( nFlags & MK_RBUTTON)
// ============================ NO BUTTON =======================
{ // No buttons
myXmax = point.x; myYmax = point.y;
if (nFlags & MK_SHIFT)
ShiftMoveEvent(point.x,point.y);
else
MoveEvent(point.x,point.y);
}
// ============================ RIGHT BUTTON =======================
if ( nFlags & MK_RBUTTON)
{
if ( nFlags & MK_CONTROL )
{
myView->Rotation(point.x,point.y);
}
}else //if ( nFlags & MK_RBUTTON)
// ============================ NO BUTTON =======================
{ // No buttons
myXmax = point.x; myYmax = point.y;
if (nFlags & MK_SHIFT)
ShiftMoveEvent(point.x,point.y);
else
MoveEvent(point.x,point.y);
}
}
void CGeometryView::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myDegenerateModeIsOn);
pCmdUI->Enable (!myDegenerateModeIsOn);
pCmdUI->SetCheck (myDegenerateModeIsOn);
pCmdUI->Enable (!myDegenerateModeIsOn);
}
void CGeometryView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (!myDegenerateModeIsOn);
pCmdUI->Enable (myDegenerateModeIsOn);
pCmdUI->SetCheck (!myDegenerateModeIsOn);
pCmdUI->Enable (myDegenerateModeIsOn);
}
void CGeometryView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_GlobalPanning);
pCmdUI->Enable (myCurrentMode != CurAction3d_GlobalPanning);
pCmdUI->SetCheck (myCurrentMode == CurAction3d_GlobalPanning);
pCmdUI->Enable (myCurrentMode != CurAction3d_GlobalPanning);
}
void CGeometryView::OnUpdateBUTTONPan(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicPanning);
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicPanning );
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicPanning);
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicPanning );
}
void CGeometryView::OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicZooming );
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicZooming);
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicZooming );
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicZooming);
}
void CGeometryView::OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_WindowZooming);
pCmdUI->Enable (myCurrentMode != CurAction3d_WindowZooming);
pCmdUI->SetCheck (myCurrentMode == CurAction3d_WindowZooming);
pCmdUI->Enable (myCurrentMode != CurAction3d_WindowZooming);
}
void CGeometryView::OnUpdateBUTTONRot(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicRotation);
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicRotation);
pCmdUI->SetCheck (myCurrentMode == CurAction3d_DynamicRotation);
pCmdUI->Enable (myCurrentMode != CurAction3d_DynamicRotation);
}
//==========================================================================================
@@ -388,72 +392,72 @@ void CGeometryView::OnUpdateBUTTONRot(CCmdUI* pCmdUI)
//
//-----------------------------------------------------------------------------------------
void CGeometryView::DragEvent(const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState )
const Standard_Integer y ,
const Standard_Integer TheState )
{
// TheState == -1 button down
// TheState == 0 move
// TheState == 1 button up
// TheState == -1 button down
// TheState == 0 move
// TheState == 1 button up
static Standard_Integer theButtonDownX=0;
static Standard_Integer theButtonDownY=0;
static Standard_Integer theButtonDownX=0;
static Standard_Integer theButtonDownY=0;
if (TheState == -1)
{
theButtonDownX=x;
theButtonDownY=y;
}
if (TheState == -1)
{
theButtonDownX=x;
theButtonDownY=y;
}
if (TheState == 0)
GetDocument()->GetAISContext()->Select(theButtonDownX,theButtonDownY,x,y,myView);
if (TheState == 0)
GetDocument()->GetAISContext()->Select(theButtonDownX,theButtonDownY,x,y,myView);
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::InputEvent(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
GetDocument()->GetAISContext()->Select();
GetDocument()->GetAISContext()->Select();
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::MoveEvent(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
GetDocument()->GetAISContext()->MoveTo(x,y,myView);
GetDocument()->GetAISContext()->MoveTo(x,y,myView);
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::ShiftMoveEvent(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
GetDocument()->GetAISContext()->MoveTo(x,y,myView);
GetDocument()->GetAISContext()->MoveTo(x,y,myView);
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::ShiftDragEvent(const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState )
const Standard_Integer y ,
const Standard_Integer TheState )
{
static Standard_Integer theButtonDownX=0;
static Standard_Integer theButtonDownY=0;
static Standard_Integer theButtonDownX=0;
static Standard_Integer theButtonDownY=0;
if (TheState == -1)
{
theButtonDownX=x;
theButtonDownY=y;
}
if (TheState == -1)
{
theButtonDownX=x;
theButtonDownY=y;
}
if (TheState == 0)
GetDocument()->GetAISContext()->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myView);
if (TheState == 0)
GetDocument()->GetAISContext()->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myView);
}
@@ -461,16 +465,16 @@ void CGeometryView::ShiftDragEvent(const Standard_Integer x ,
//
//-----------------------------------------------------------------------------------------
void CGeometryView::ShiftInputEvent(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
GetDocument()->GetAISContext()->ShiftSelect();
GetDocument()->GetAISContext()->ShiftSelect();
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::Popup(const Standard_Integer x,
const Standard_Integer y )
const Standard_Integer y )
{
Standard_Integer PopupMenuNumber=0;
GetDocument()->GetAISContext()->InitCurrent();
@@ -481,13 +485,13 @@ void CGeometryView::Popup(const Standard_Integer x,
VERIFY(menu.LoadMenu(IDR_Popup3D));
CMenu* pPopup = menu.GetSubMenu(PopupMenuNumber);
ASSERT(pPopup != NULL);
POINT winCoord = { x , y };
Handle(WNT_Window) aWNTWindow=
Handle(WNT_Window)::DownCast(myView->Window());
Handle(WNT_Window)::DownCast(myView->Window());
ClientToScreen ( &winCoord);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON , winCoord.x, winCoord.y ,
AfxGetMainWnd());
AfxGetMainWnd());
}

View File

@@ -15,72 +15,77 @@ class CGeometryView : public OCC_3dView
{
protected: // create from serialization only
public:
CGeometryView();
DECLARE_DYNCREATE(CGeometryView)
CGeometryView();
DECLARE_DYNCREATE(CGeometryView)
// Attributes
// Attributes
public:
CGeometryDoc* GetDocument();
CGeometryDoc* GetDocument();
// Operations
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeometryView)
public:
//}}AFX_VIRTUAL
// Implementation
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeometryView)
public:
virtual ~CGeometryView();
void FitAll(Quantity_Coefficient Coef) { if (Coef != -1) myView->FitAll(Coef);
else myView->FitAll();
myView->ZFitAll(); };
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGeometryView();
void FitAll(Quantity_Coefficient Coef)
{
if (Coef != -1)
myView->FitAll(Coef);
else myView->FitAll();
myView->ZFitAll();
};
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGeometryView)
afx_msg void OnFileExportImage();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CGeometryView)
afx_msg void OnFileExportImage();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void DragEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState);
void InputEvent (const Standard_Integer x ,
const Standard_Integer y );
void MoveEvent (const Standard_Integer x ,
const Standard_Integer y );
void ShiftMoveEvent (const Standard_Integer x ,
const Standard_Integer y );
void ShiftDragEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState);
void ShiftInputEvent(const Standard_Integer x ,
const Standard_Integer y );
void Popup (const Standard_Integer x ,
const Standard_Integer y );
void DragEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState);
void InputEvent (const Standard_Integer x ,
const Standard_Integer y );
void MoveEvent (const Standard_Integer x ,
const Standard_Integer y );
void ShiftMoveEvent (const Standard_Integer x ,
const Standard_Integer y );
void ShiftDragEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState);
void ShiftInputEvent(const Standard_Integer x ,
const Standard_Integer y );
void Popup (const Standard_Integer x ,
const Standard_Integer y );
};

View File

@@ -14,16 +14,16 @@
IMPLEMENT_DYNCREATE(CGeometryView2D, CView)
BEGIN_MESSAGE_MAP(CGeometryView2D, OCC_2dView)
//{{AFX_MSG_MAP(CGeometryView2D)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MBUTTONDOWN()
ON_WM_MBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
//{{AFX_MSG_MAP(CGeometryView2D)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MBUTTONDOWN()
ON_WM_MBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -41,11 +41,11 @@ CGeometryView2D::~CGeometryView2D()
void CGeometryView2D::OnDraw(CDC* pDC)
{
CGeometryDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
CGeometryDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!myV2dView.IsNull())
myV2dView->Update();
if (!myV2dView.IsNull())
myV2dView->Update();
}
/////////////////////////////////////////////////////////////////////////////
@@ -54,18 +54,18 @@ void CGeometryView2D::OnDraw(CDC* pDC)
#ifdef _DEBUG
void CGeometryView2D::AssertValid() const
{
CView::AssertValid();
CView::AssertValid();
}
void CGeometryView2D::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
CView::Dump(dc);
}
CGeometryDoc* CGeometryView2D::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc)));
return (CGeometryDoc*)m_pDocument;
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc)));
return (CGeometryDoc*)m_pDocument;
}
#endif //_DEBUG
@@ -83,233 +83,227 @@ void CGeometryView2D::OnLButtonDown(UINT nFlags, CPoint point)
myXmax=point.x; myYmax=point.y;
if ( nFlags & MK_CONTROL )
{
// Button MB1 down Control :start zomming
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction2d_Nothing : // start a drag
GetDocument()->DragEvent2D(point.x,point.y,-1,myV2dView);
break;
case CurAction2d_DynamicZooming : // noting
break;
case CurAction2d_WindowZooming :
break;
case CurAction2d_DynamicPanning :// noting
break;
case CurAction2d_GlobalPanning :// noting
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}
{
// Button MB1 down Control :start zomming
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction2d_Nothing : // start a drag
GetDocument()->DragEvent2D(point.x,point.y,-1,myV2dView);
break;
case CurAction2d_DynamicZooming : // noting
break;
case CurAction2d_WindowZooming :
break;
case CurAction2d_DynamicPanning :// noting
break;
case CurAction2d_GlobalPanning :// noting
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}
}
}
void CGeometryView2D::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if ( nFlags & MK_CONTROL )
{
return;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction2d_Nothing :
if (point.x == myXmin && point.y == myYmin)
{ // no offset between down and up --> selectEvent
myXmax=point.x;
myYmax=point.y;
if (nFlags & MK_SHIFT )
GetDocument()->ShiftInputEvent2D(point.x,point.y,myV2dView);
else
GetDocument()->InputEvent2D (point.x,point.y,myV2dView);
} else
{
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax=point.x;
myYmax=point.y;
if (nFlags & MK_SHIFT)
GetDocument()->ShiftDragEvent2D(point.x,point.y,1,myV2dView);
else
GetDocument()->DragEvent2D(point.x,point.y,1,myV2dView);
}
break;
case CurAction2d_DynamicZooming :
// SetCursor(AfxGetApp()->LoadStandardCursor());
myCurrentMode = CurAction2d_Nothing;
break;
case CurAction2d_WindowZooming :
myXmax=point.x; myYmax=point.y;
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
// Test if the zoom window is greater than a minimale window.
{
// Do the zoom window between Pmin and Pmax
myV2dView->WindowFit(myXmin,myYmin,myXmax,myYmax);
}
myCurrentMode = CurAction2d_Nothing;
break;
case CurAction2d_DynamicPanning :
myCurrentMode = CurAction2d_Nothing;
break;
case CurAction2d_GlobalPanning :
myV2dView->Place(point.x,point.y,myCurZoom);
myCurrentMode = CurAction2d_Nothing;
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
// TODO: Add your message handler code here and/or call default
if ( nFlags & MK_CONTROL )
{
return;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction2d_Nothing :
if (point.x == myXmin && point.y == myYmin)
{ // no offset between down and up --> selectEvent
myXmax=point.x;
myYmax=point.y;
if (nFlags & MK_SHIFT )
GetDocument()->ShiftInputEvent2D(point.x,point.y,myV2dView);
else
GetDocument()->InputEvent2D (point.x,point.y,myV2dView);
} else
{
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax=point.x;
myYmax=point.y;
if (nFlags & MK_SHIFT)
GetDocument()->ShiftDragEvent2D(point.x,point.y,1,myV2dView);
else
GetDocument()->DragEvent2D(point.x,point.y,1,myV2dView);
}
break;
case CurAction2d_DynamicZooming :
// SetCursor(AfxGetApp()->LoadStandardCursor());
myCurrentMode = CurAction2d_Nothing;
break;
case CurAction2d_WindowZooming :
myXmax=point.x; myYmax=point.y;
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
if ((abs(myXmin-myXmax)>ValZWMin) || (abs(myYmin-myYmax)>ValZWMin))
// Test if the zoom window is greater than a minimale window.
{
// Do the zoom window between Pmin and Pmax
myV2dView->WindowFit(myXmin,myYmin,myXmax,myYmax);
}
myCurrentMode = CurAction2d_Nothing;
break;
case CurAction2d_DynamicPanning :
myCurrentMode = CurAction2d_Nothing;
break;
case CurAction2d_GlobalPanning :
myV2dView->Place(point.x,point.y,myCurZoom);
myCurrentMode = CurAction2d_Nothing;
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
}
void CGeometryView2D::OnMButtonDown(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
// Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
if ( nFlags & MK_CONTROL )
{
// Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
}
void CGeometryView2D::OnMButtonUp(UINT nFlags, CPoint point)
{
if ( nFlags & MK_CONTROL )
{
// Button MB2 up Control : panning stop
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
if ( nFlags & MK_CONTROL )
{
// Button MB2 up Control : panning stop
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
}
void CGeometryView2D::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if ( nFlags & MK_CONTROL )
{
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else // if ( Ctrl )
{
GetDocument()->Popup2D(point.x,point.y,myV2dView);
}
// TODO: Add your message handler code here and/or call default
if ( nFlags & MK_CONTROL )
{
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else // if ( Ctrl )
{
GetDocument()->Popup2D(point.x,point.y,myV2dView);
}
}
void CGeometryView2D::OnRButtonUp(UINT nFlags, CPoint point)
{
OCC_2dView::Popup2D(point.x,point.y);
OCC_2dView::Popup2D(point.x,point.y);
}
void CGeometryView2D::OnMouseMove(UINT nFlags, CPoint point)
{
// ============================ LEFT BUTTON =======================
// ============================ LEFT BUTTON =======================
if ( nFlags & MK_LBUTTON)
{
if ( nFlags & MK_CONTROL )
{
if ( nFlags & MK_CONTROL )
{
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myV2dView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min
myXmax = point.x;
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myV2dView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min
myXmax = point.x;
myYmax = point.y;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction2d_Nothing :
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax = point.x;
myYmax = point.y;
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction2d_Nothing :
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax = point.x;
myYmax = point.y;
GetDocument()->DragEvent2D(myXmax,myYmax,0,myV2dView);
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_True);
break;
case CurAction2d_DynamicZooming :
myV2dView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min \n";
myXmax=point.x; myYmax=point.y;
break;
case CurAction2d_WindowZooming :
myXmax = point.x; myYmax = point.y;
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
break;
case CurAction2d_DynamicPanning :
myV2dView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
break;
case CurAction2d_GlobalPanning : // nothing
GetDocument()->DragEvent2D(myXmax,myYmax,0,myV2dView);
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_True);
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
case CurAction2d_DynamicZooming :
myV2dView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate in min \n";
myXmax=point.x; myYmax=point.y;
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
} else // if ( nFlags & MK_LBUTTON)
case CurAction2d_WindowZooming :
myXmax = point.x; myYmax = point.y;
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_False,LongDash);
DrawRectangle2D(myXmin,myYmin,myXmax,myYmax,Standard_True,LongDash);
break;
case CurAction2d_DynamicPanning :
myV2dView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
break;
case CurAction2d_GlobalPanning : // nothing
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
} else // if ( nFlags & MK_LBUTTON)
// ============================ MIDDLE BUTTON =======================
if ( nFlags & MK_MBUTTON)
{
if ( nFlags & MK_CONTROL )
{
myV2dView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
if ( nFlags & MK_CONTROL )
{
myV2dView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
}
}
} else // if ( nFlags & MK_MBUTTON)
// ============================ RIGHT BUTTON =======================
if ( nFlags & MK_RBUTTON)
{
}else //if ( nFlags & MK_RBUTTON)
// ============================ NO BUTTON =======================
{ // No buttons
myXmax = point.x; myYmax = point.y;
if (nFlags & MK_SHIFT)
GetDocument()->ShiftMoveEvent2D(point.x,point.y,myV2dView);
else
GetDocument()->MoveEvent2D(point.x,point.y,myV2dView);
}
// ============================ RIGHT BUTTON =======================
if ( nFlags & MK_RBUTTON)
{
}else //if ( nFlags & MK_RBUTTON)
// ============================ NO BUTTON =======================
{ // No buttons
myXmax = point.x; myYmax = point.y;
if (nFlags & MK_SHIFT)
GetDocument()->ShiftMoveEvent2D(point.x,point.y,myV2dView);
else
GetDocument()->MoveEvent2D(point.x,point.y,myV2dView);
}
}
void CGeometryView2D::OnSize(UINT nType, int cx, int cy)
{
if (!myV2dView.IsNull())
{
myV2dView->MustBeResized(V2d_TOWRE_ENLARGE_SPACE); // added sro
}
if (!myV2dView.IsNull())
{
myV2dView->MustBeResized(); // added sro
}
}
void CGeometryView2D::OnInitialUpdate()
{
Handle(WNT_Window) aWNTWindow;
aWNTWindow = new WNT_Window(((CGeometryApp*)AfxGetApp())->GetGraphicDevice(),GetSafeHwnd());
aWNTWindow->SetBackground(Quantity_NOC_BLACK);
Handle(WNT_Window) aWNTWindow;
aWNTWindow = new WNT_Window(GetSafeHwnd());
Handle(WNT_WDriver) aDriver= new WNT_WDriver(aWNTWindow);
myV2dView = new V2d_View(aDriver, GetDocument()->GetViewer2D(),0,0,50);
myV2dView = GetDocument()->GetViewer2D()->CreateView();
myV2dView->SetWindow(aWNTWindow);
myV2dView->SetBackgroundColor(Quantity_NOC_BLACK);
// initialyse the grids dialogs
TheRectangularGridDialog.Create(CRectangularGrid::IDD, NULL);
TheCircularGridDialog.Create(CCircularGrid::IDD, NULL);
TheRectangularGridDialog.SetViewer (GetDocument()->GetViewer2D());
TheCircularGridDialog.SetViewer (GetDocument()->GetViewer2D());
Standard_Integer w=100 , h=100 ; /* Debug Matrox */
aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */
/* Resize is not supposed to be done on */
/* Matrox */
/* I suspect another problem elsewhere */
::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
// initialyse the grids dialogs
TheRectangularGridDialog.Create(CRectangularGrid::IDD, NULL);
TheCircularGridDialog.Create(CCircularGrid::IDD, NULL);
TheRectangularGridDialog.SetViewer (GetDocument()->GetViewer2D());
TheCircularGridDialog.SetViewer (GetDocument()->GetViewer2D());
Standard_Integer w=100 , h=100 ; /* Debug Matrox */
aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */
/* Resize is not supposed to be done on */
/* Matrox */
/* I suspect another problem elsewhere */
::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
}

View File

@@ -12,62 +12,46 @@
#include <OCC_2dView.h>
/////////////////////////////////////////////////////////////////////////////
/*
enum CurrentAction2d {
CurAction_Nothing,
CurAction_DynamicZooming,
CurAction_WindowZooming,
CurAction_DynamicPanning,
CurAction_GlobalPanning,
};
*/
#define ValZWMin 1
class CGeometryView2D : public OCC_2dView
{
protected: // create from serialization only
CGeometryView2D();
DECLARE_DYNCREATE(CGeometryView2D)
CGeometryView2D();
DECLARE_DYNCREATE(CGeometryView2D)
// Attributes
// Attributes
public:
CGeometryDoc* GetDocument();
CGeometryDoc* GetDocument();
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNSGViewBib)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate(); // called first time after construct
//}}AFX_VIRTUAL
// Implementation
// Overrides
// ClassWizard generated virtual function overrides
public:
virtual ~CGeometryView2D();
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate(); // called first time after construct
// Implementation
public:
virtual ~CGeometryView2D();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
// Generated message map functions
protected:
//{{AFX_MSG(CGeometryView2D)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CGeometryView2D)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in NSGViewBibliotheque.cpp

View File

@@ -6,37 +6,12 @@
IMPLEMENT_STANDARD_HANDLE(ISession2D_Curve,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
#include <Graphic2d_SetOfCurves.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Bnd_Box2d.hxx>
#include <BndLib_Add2dCurve.hxx>
#include <Precision.hxx>
#include <Select2D_SensitiveBox.hxx>
#include <Select2D_SensitiveSegment.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Ax2d.hxx>
#include <Select2D_SensitiveArc.hxx>
#include <Geom2d_Curve.hxx>
#include <GeomTools_Curve2dSet.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <gp_Pnt2d.hxx>
#include <GCE2d_MakeSegment.hxx>
#include <gp_Vec2d.hxx>
#include <OSD_Environment.hxx>
#include <Graphic2d_Array1OfVertex.hxx>
#include <Graphic2d_PolyLine.hxx>
#include <SelectMgr_Selection.hxx>
#include <Graphic2d_Segment.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Graphic2d_Vertex.hxx>
#include <Geom2d_BezierCurve.hxx>
ISession2D_Curve::ISession2D_Curve(const Handle_Geom2d_Curve aGeom2dCurve,
const Aspect_TypeOfLine aTypeOfLine,
const Aspect_WidthOfLine aWidthOfLine,
const Standard_Integer aColorIndex)
:AIS_InteractiveObject()
ISession2D_Curve::ISession2D_Curve(const Handle_Geom2d_Curve aGeom2dCurve,
const Aspect_TypeOfLine aTypeOfLine,
const Aspect_WidthOfLine aWidthOfLine,
const Standard_Integer aColorIndex)
:AIS_InteractiveObject()
{
myGeom2dCurve = aGeom2dCurve;
myTypeOfLine = aTypeOfLine ;
@@ -49,51 +24,52 @@ IMPLEMENT_STANDARD_RTTIEXT(ISession2D_Curve,AIS_InteractiveObject)
myradiusratio = 1;
}
void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer aMode)
void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
Handle(Graphic2d_SetOfCurves) segment;
segment = new Graphic2d_SetOfCurves(aGrObj);
segment->Add(myGeom2dCurve);
segment->SetColorIndex (myColorIndex);
segment->SetWidthIndex (myWidthOfLine + 1);
segment->SetTypeIndex (myTypeOfLine + 1);
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor,1.e-2);
if(anEdgeDistrib.IsDone())
{
Handle(Graphic3d_ArrayOfPolylines) aCurve =
new Graphic3d_ArrayOfPolylines(anEdgeDistrib.NbPoints());
for(Standard_Integer i=1;i<=anEdgeDistrib.NbPoints();++i)
aCurve->AddVertex(anEdgeDistrib.Value(i));
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aCurve);
}
if (myDisplayPole)
{
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve )
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Graphic2d_Array1OfVertex anArrayOfVertex(1,aBezier->NbPoles());
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for(int i=1;i<=aBezier->NbPoles();i++)
{
gp_Pnt2d CurrentPoint = aBezier->Pole(i);
Graphic2d_Vertex aVertex(CurrentPoint.X(),CurrentPoint.Y());
anArrayOfVertex(i)=aVertex;
}
Handle(Graphic2d_Polyline) aPolyline = new Graphic2d_Polyline(aGrObj,anArrayOfVertex);
{
gp_Pnt2d CurrentPoint = aBezier->Pole(i);
anArrayOfVertex->AddVertex(CurrentPoint.X(),CurrentPoint.Y(),0.);
}
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve )
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Graphic2d_Array1OfVertex anArrayOfVertex(1,aBSpline->NbPoles());
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex =
new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
for(int i=1;i<=aBSpline->NbPoles();i++)
{
gp_Pnt2d CurrentPoint = aBSpline->Pole(i);
Graphic2d_Vertex aVertex(CurrentPoint.X(),CurrentPoint.Y());
anArrayOfVertex(i)=aVertex;
}
Handle(Graphic2d_Polyline) aPolyline = new Graphic2d_Polyline(aGrObj,anArrayOfVertex);
{
gp_Pnt2d CurrentPoint = aBSpline->Pole(i);
anArrayOfVertex->AddVertex(CurrentPoint.X(),CurrentPoint.Y(),0.);
}
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(anArrayOfVertex);
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
{
@@ -106,37 +82,39 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager2d)& aPres
gp_Pnt2d P1, P2;
for (intrv = 1; intrv <= nbintv; intrv++)
{
Standard_Real t = TI(intrv);
Standard_Real step = (TI(intrv+1) - t) / GetDiscretisation();
Standard_Real LRad, ratio;
for (ii = 1; ii <= myDiscretisation; ii++)
{
LProp.SetParameter(t);
{
Standard_Real t = TI(intrv);
Standard_Real step = (TI(intrv+1) - t) / GetDiscretisation();
Standard_Real LRad, ratio;
for (ii = 1; ii <= myDiscretisation; ii++)
{
LProp.SetParameter(t);
if (LProp.IsTangentDefined())
{
Curvature = Abs(LProp.Curvature());
if ( Curvature > Resolution)
{
myGeom2dCurve->D0(t, P1);
LRad = 1./Curvature;
ratio = ( ( LRad > myradiusmax) ? myradiusmax/LRad : 1 );
ratio *= myradiusratio;
LProp.CentreOfCurvature(P2);
gp_Vec2d V(P1, P2);
gp_Pnt2d P3 = P1.Translated(ratio*V);
Handle(Graphic2d_Segment) aSegment = new Graphic2d_Segment(aGrObj,P1.X(),P1.Y(),P3.X(),P3.Y());
}
}
t += step;
}
{
Curvature = Abs(LProp.Curvature());
if ( Curvature > Resolution)
{
myGeom2dCurve->D0(t, P1);
LRad = 1./Curvature;
ratio = ( ( LRad > myradiusmax) ? myradiusmax/LRad : 1 );
ratio *= myradiusratio;
LProp.CentreOfCurvature(P2);
gp_Vec2d V(P1, P2);
gp_Pnt2d P3 = P1.Translated(ratio*V);
Handle(Graphic3d_ArrayOfPolylines) aSegment = new Graphic3d_ArrayOfPolylines(2);
aSegment->AddVertex(P1.X(),P1.Y(),0.);
aSegment->AddVertex(P3.X(),P3.Y(),0.);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aSegment);
}
}
t += step;
}
}
}
}
void ISession2D_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
const Standard_Integer aMode)
{
}

View File

@@ -10,9 +10,7 @@
#include <Aspect_WidthOfline.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <Handle_PrsMgr_PresentationManager2d.hxx>
#include <Handle_Graphic2d_GraphicObject.hxx>
#include <Handle_SelectMgr_Selection.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Standard_CString.hxx>
@@ -21,7 +19,6 @@ class TColGeom2d_HSequenceOfCurve;
class PrsMgr_PresentationManager2d;
class Graphic2d_GraphicObject;
class SelectMgr_Selection;
class ISession2D_ObjectOwner;
#include "Geom2d_Curve.hxx"
@@ -32,81 +29,56 @@ class ISession2D_Curve : public AIS_InteractiveObject {
public:
// Methods PUBLIC
//
// Methods PUBLIC
//
ISession2D_Curve
(const Handle_Geom2d_Curve aGeom2dCurve,
const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID,
const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM,
const Standard_Integer aColorIndex = 4);
ISession2D_Curve
(const Handle_Geom2d_Curve aGeom2dCurve,
const Aspect_TypeOfLine aTypeOfline = Aspect_TOL_SOLID,
const Aspect_WidthOfLine aWidthOfLine = Aspect_WOL_MEDIUM,
const Standard_Integer aColorIndex = 4);
inline Standard_Integer NbPossibleSelection() const;
inline Standard_Integer NbPossibleSelection() const;
inline Aspect_TypeOfLine GetTypeOfLine
() const;
inline void SetTypeOfLine
(const Aspect_TypeOfLine aNewTypeOfLine) ;
inline Aspect_WidthOfLine GetWidthOfLine
() const;
inline void SetWidthOfLine
(const Aspect_WidthOfLine aNewWidthOfLine) ;
inline Standard_Integer GetColorIndex
() const;
inline void SetColorIndex
(const Standard_Integer aNewColorIndex) ;
inline Aspect_TypeOfLine GetTypeOfLine() const;
inline void SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine);
inline Standard_Boolean GetDisplayPole
() const;
inline void SetDisplayPole
(const Standard_Boolean aNewDisplayPole) ;
inline Aspect_WidthOfLine GetWidthOfLine() const;
inline void SetWidthOfLine(const Aspect_WidthOfLine aNewWidthOfLine);
inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure
() const;
inline void ISession2D_Curve::SetDisplayCurbure
(const Standard_Boolean aNewDisplayCurbure);
inline Standard_Integer GetColorIndex() const;
inline void SetColorIndex(const Standard_Integer aNewColorIndex) ;
inline Standard_Boolean GetDisplayPole() const;
inline void SetDisplayPole(const Standard_Boolean aNewDisplayPole) ;
inline Standard_Real GetDiscretisation
() const;
inline void SetDiscretisation
(const Standard_Real aNewDiscretisation) ;
inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure() const;
inline void ISession2D_Curve::SetDisplayCurbure
(const Standard_Boolean aNewDisplayCurbure);
inline Standard_Real GetDiscretisation() const;
inline void SetDiscretisation(const Standard_Real aNewDiscretisation) ;
DEFINE_STANDARD_RTTI(ISession2D_Curve)
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
DEFINE_STANDARD_RTTI(ISession2D_Curve)
private:
// Methods PRIVATE
//
virtual void Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,const Handle(Graphic2d_GraphicObject)& aGrObj,const Standard_Integer aMode = 0) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
// Fields PRIVATE
//
Handle_Geom2d_Curve myGeom2dCurve;
Aspect_TypeOfLine myTypeOfLine;
Aspect_WidthOfLine myWidthOfLine;
Standard_Integer myColorIndex;
Standard_Boolean myDisplayPole;
Standard_Boolean myDisplayCurbure;
Standard_Real myDiscretisation;
Standard_Real myradiusmax ;
Standard_Real myradiusratio ;
// Methods PRIVATE
//
virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
// Fields PRIVATE
//
Handle_Geom2d_Curve myGeom2dCurve;
Aspect_TypeOfLine myTypeOfLine;
Aspect_WidthOfLine myWidthOfLine;
Standard_Integer myColorIndex;
Standard_Boolean myDisplayPole;
Standard_Boolean myDisplayCurbure;
Standard_Real myDiscretisation;
Standard_Real myradiusmax ;
Standard_Real myradiusratio ;
};
@@ -116,14 +88,14 @@ Standard_Real myradiusratio ;
inline Standard_Integer ISession2D_Curve::NbPossibleSelection() const
{
return 1;
return 1;
}
inline Aspect_TypeOfLine ISession2D_Curve::GetTypeOfLine() const
{
return myTypeOfLine ;
}
inline void ISession2D_Curve::SetTypeOfLine(const Aspect_TypeOfLine aNewTypeOfLine)
{
myTypeOfLine = aNewTypeOfLine;
@@ -150,37 +122,37 @@ inline void ISession2D_Curve::SetColorIndex(const Standard_Integer aNewColorInd
}
inline Standard_Boolean ISession2D_Curve::GetDisplayPole
() const
() const
{
return myDisplayPole;
return myDisplayPole;
}
inline void ISession2D_Curve::SetDisplayPole
(const Standard_Boolean aNewDisplayPole)
(const Standard_Boolean aNewDisplayPole)
{
myDisplayPole = aNewDisplayPole;
myDisplayPole = aNewDisplayPole;
}
inline Standard_Boolean ISession2D_Curve::GetDisplayCurbure
() const
() const
{
return myDisplayCurbure;
return myDisplayCurbure;
}
inline void ISession2D_Curve::SetDisplayCurbure
(const Standard_Boolean aNewDisplayCurbure)
(const Standard_Boolean aNewDisplayCurbure)
{
myDisplayCurbure = aNewDisplayCurbure;
myDisplayCurbure = aNewDisplayCurbure;
}
inline Standard_Real ISession2D_Curve::GetDiscretisation
() const
() const
{
return myDiscretisation;
return myDiscretisation;
}
inline void ISession2D_Curve::SetDiscretisation
(const Standard_Real aNewDiscretisation)
(const Standard_Real aNewDiscretisation)
{
myDiscretisation = aNewDiscretisation;
myDiscretisation = aNewDiscretisation;
}

View File

@@ -1,166 +0,0 @@
#include "stdafx.h"
#include <ISession2D_InteractiveContext.h>
IMPLEMENT_STANDARD_HANDLE(ISession2D_InteractiveContext,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_InteractiveContext,MMgt_TShared)
#include <Aspect_Window.hxx>
#include <Aspect_Background.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <V2d_Viewer.hxx>
#include <V2d_View.hxx>
#include <PrsMgr_PresentationManager2d.hxx>
#include <StdSelect_ViewerSelector2d.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
ISession2D_InteractiveContext::ISession2D_InteractiveContext()
{
}
ISession2D_InteractiveContext::ISession2D_InteractiveContext(const Handle(V2d_Viewer)& aViewer)
{
Initialize(aViewer);
}
void ISession2D_InteractiveContext::Initialize(const Handle(V2d_Viewer)& aViewer)
{
myViewer = aViewer;
myPrsmgr = new PrsMgr_PresentationManager2d(myViewer->View());
mySelectionManager = new SelectMgr_SelectionManager();
mySelector = new StdSelect_ViewerSelector2d();
mySelector->Set(3);
// set Sensitivity very very important for SensitiveCurve !!
mySelector->SetSensitivity (0.5); // en mm
mySelectionManager->Add(mySelector);
}
void ISession2D_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anObject,
const Standard_Boolean Redraw)
{
myMapOfObject.Add(anObject);
myPrsmgr->Display(anObject);//,anObject->DisplayMode());
mySelectionManager->Load(anObject,mySelector);
mySelectionManager->Activate(anObject,0,mySelector);
if (Redraw) myViewer->Update();
}
void ISession2D_InteractiveContext::Erase(const Handle(AIS_InteractiveObject)& anObject,
const Standard_Boolean Redraw)
{
if (!anObject.IsNull())
{
myPrsmgr->Erase(anObject);//,anObject->DisplayMode());
mySelectionManager
->Deactivate(anObject,mySelector);
if (Redraw) myViewer->Update();
}
}
void ISession2D_InteractiveContext::Move(const Handle(V2d_View)& aView,
const Standard_Integer x1,
const Standard_Integer y1)
{
if (!aBuffer.IsNull())
{
aBuffer->UnPost();
aBuffer->Clear();
}
if (myViewer->IsActive()) // A propos de la grille !!!
{
aView->ShowHit(x1,y1);
}
aBuffer =new Graphic2d_Buffer(aView->View(),0,0,3,5);
mySelector->Pick(x1,y1,aView);
Handle(SelectMgr_SelectableObject) aSelectableObject;
mySelector->Init();
while (mySelector->More())
{
aSelectableObject = Handle(SelectMgr_SelectableObject)::DownCast(mySelector->Picked()->Selectable());
myPrsmgr->Dump(aBuffer,aSelectableObject) ;
aBuffer->Post();
mySelector->Next();
}
}
void ISession2D_InteractiveContext::Pick(const Handle(V2d_View)& aView,
const Standard_Integer x1,
const Standard_Integer y1)
{
if (myViewer->IsActive()) // A propos de la grille !!!
{
aView->ShowHit(x1,y1);
}
mySelector->Pick(x1,y1,aView);
Handle(SelectMgr_SelectableObject) aSelectableObject;
mySelector->Init();
while (mySelector->More())
{
Handle(SelectMgr_EntityOwner) aOwn= mySelector->Picked();
aSelectableObject = Handle(SelectMgr_SelectableObject)::DownCast(aOwn->Selectable());
myPrsmgr->ColorHighlight(aSelectableObject,5,0) ;
mySelector->Next();
}
if (myViewer->IsActive()) // A propos de la grille !!!
{
aView->ShowHit(x1,y1);
}
}
void ISession2D_InteractiveContext::DisplayAreas()
{
myViewer->InitActiveViews();
while(myViewer->MoreActiveViews())
{
Handle(V2d_View) aView = myViewer->ActiveView();
mySelector->DisplayAreas(aView);
myViewer->NextActiveViews();
}
myViewer->Update();
}
void ISession2D_InteractiveContext::ClearAreas()
{
mySelector->ClearAreas();
myViewer->Update();
}
void ISession2D_InteractiveContext::EraseAll()
{
TColStd_MapIteratorOfMapOfTransient anIterator(myMapOfObject);
for (;anIterator.More();anIterator.Next())
{
Handle(Standard_Transient) aTransient = anIterator.Key();
Handle(AIS_InteractiveObject) anObject = Handle(AIS_InteractiveObject)::DownCast(aTransient);
if (!anObject.IsNull())
{
myPrsmgr->Erase(anObject);
mySelectionManager
->Deactivate(Handle(AIS_InteractiveObject)::DownCast(anObject),mySelector);
}
else
{
Standard_CString ObjectTypeName = aTransient->DynamicType()->Name();
}
}
myViewer->Update();
}

View File

@@ -1,98 +0,0 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#ifndef _ISession2D_InteractiveContext_HeaderFile
#define _ISession2D_InteractiveContext_HeaderFile
#include <Standard_Macro.hxx>
#include <Standard_DefineHandle.hxx>
#include <Handle_V2d_Viewer.hxx>
#include <Handle_PrsMgr_PresentationManager2d.hxx>
#include <Handle_SelectMgr_SelectionManager.hxx>
#include <Handle_StdSelect_ViewerSelector2d.hxx>
#include <MMgt_TShared.hxx>
#include <Handle_SelectMgr_SelectableObject.hxx>
#include <Standard_Boolean.hxx>
#include <Handle_V2d_View.hxx>
#include <Graphic2d_Buffer.hxx>
class V2d_Viewer;
class PrsMgr_PresentationManager2d;
class SelectMgr_SelectionManager;
#include <StdSelect_ViewerSelector2d.hxx>
class SelectMgr_SelectableObject;
class V2d_View;
#include "TColStd_MapOfTransient.hxx"
DEFINE_STANDARD_HANDLE(ISession2D_InteractiveContext,MMgt_TShared)
class ISession2D_InteractiveContext : public MMgt_TShared {
public:
void EraseAll();
// Methods PUBLIC
//
ISession2D_InteractiveContext();
ISession2D_InteractiveContext(const Handle(V2d_Viewer)& aViewer);
void Initialize(const Handle(V2d_Viewer)& aViewer) ;
void Display(const Handle(AIS_InteractiveObject)& anObject,const Standard_Boolean Redraw = Standard_True) ;
void Erase(const Handle(AIS_InteractiveObject)& anObject,const Standard_Boolean Redraw = Standard_True) ;
virtual void Move(const Handle(V2d_View)& aView,const Standard_Integer x1,const Standard_Integer y1) ;
void Pick(const Handle(V2d_View)& aView,
const Standard_Integer x1,
const Standard_Integer y1);
void DisplayAreas() ;
void ClearAreas() ;
DEFINE_STANDARD_RTTI(ISession2D_InteractiveContext)
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
TColStd_MapOfTransient myMapOfObject;
// Methods PRIVATE
//
// Fields PRIVATE
//
Handle(V2d_Viewer) myViewer;
Handle_PrsMgr_PresentationManager2d myPrsmgr;
Handle_SelectMgr_SelectionManager mySelectionManager;
Handle_StdSelect_ViewerSelector2d mySelector;
// for dynamic selection
Handle(Graphic2d_Buffer) aBuffer;
};
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -4,17 +4,8 @@
#include <ISession2D_SensitiveCurve.h>
IMPLEMENT_STANDARD_HANDLE(ISession2D_SensitiveCurve,Select2D_SensitiveEntity)
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_SensitiveCurve,Select2D_SensitiveEntity)
#include <Bnd_Box2d.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Vec2d.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <SelectBasics_BasicTool.hxx>
#include "GCPnts_TangentialDeflection.hxx"
#include "Geom2dAdaptor_Curve.hxx"
IMPLEMENT_STANDARD_HANDLE(ISession2D_SensitiveCurve,Select3D_SensitiveEntity)
IMPLEMENT_STANDARD_RTTIEXT(ISession2D_SensitiveCurve,Select3D_SensitiveEntity)
//=====================================================
// Function : Create
@@ -27,7 +18,7 @@ ISession2D_SensitiveCurve(const Handle(SelectBasics_EntityOwner)& OwnerId,
const Handle(Geom2d_Curve)& C,
const Standard_Real CDeflect,
const Standard_Integer MaxRect):
Select2D_SensitiveEntity(OwnerId),
Select3D_SensitiveEntity(OwnerId),
myMaxRect(MaxRect),
myCurve(C),
myCDeflect(CDeflect)

View File

@@ -21,8 +21,8 @@
#include <Standard_Integer.hxx>
#include <gp_Pnt2d.hxx>
#include <Select2D_SensitiveEntity.hxx>
#include <Handle_SelectBasics_EntityOwner.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class SelectBasics_EntityOwner;
@@ -32,57 +32,38 @@ class gp_Pnt2d;
#include <Geom2d_Curve.hxx>
DEFINE_STANDARD_HANDLE(ISession2D_SensitiveCurve,Select2D_SensitiveEntity)
class ISession2D_SensitiveCurve : public Select2D_SensitiveEntity {
DEFINE_STANDARD_HANDLE(ISession2D_SensitiveCurve,Select3D_SensitiveEntity)
class ISession2D_SensitiveCurve : public Select3D_SensitiveEntity {
public:
// Methods PUBLIC
//
Standard_EXPORT ISession2D_SensitiveCurve(const Handle(SelectBasics_EntityOwner)& OwnerId,
const Handle(Geom2d_Curve)& C,
const Standard_Real CDeflect,
const Standard_Integer MaxRect = 3);
inline void SetMaxBoxes(const Standard_Integer MaxRect) ;
inline virtual Standard_Integer MaxBoxes() const;
Standard_EXPORT ISession2D_SensitiveCurve(const Handle(SelectBasics_EntityOwner)& OwnerId,
const Handle(Geom2d_Curve)& C,
const Standard_Real CDeflect,
const Standard_Integer MaxRect = 3);
inline void SetMaxBoxes(const Standard_Integer MaxRect) ;
inline virtual Standard_Integer MaxBoxes() const;
inline void SetCurve(const Handle(Geom2d_Curve) aCurve) ;
inline Handle(Geom2d_Curve) GetCurve() ;
inline void SetCurve(const Handle(Geom2d_Curve) aCurve) ;
inline Handle(Geom2d_Curve) GetCurve() ;
void Compute();
void Compute();
Standard_EXPORT void Areas(SelectBasics_ListOfBox2d& aSeq) ;
Standard_EXPORT Standard_Boolean Matches(const Standard_Real XMin,const Standard_Real YMin,const Standard_Real XMax,const Standard_Real YMax,const Standard_Real aTol) ;
Standard_EXPORT Standard_Boolean Matches(const Standard_Real X,const Standard_Real Y,const Standard_Real aTol,Standard_Real& DMin) ;
Handle(TColgp_HArray1OfPnt2d) SensitivePolygon();
Standard_EXPORT void Areas(SelectBasics_ListOfBox2d& aSeq) ;
Standard_EXPORT Standard_Boolean Matches(const Standard_Real XMin,const Standard_Real YMin,const Standard_Real XMax,const Standard_Real YMax,const Standard_Real aTol) ;
Standard_EXPORT Standard_Boolean Matches(const Standard_Real X,const Standard_Real Y,const Standard_Real aTol,Standard_Real& DMin) ;
Handle(TColgp_HArray1OfPnt2d) SensitivePolygon();
DEFINE_STANDARD_RTTI(ISession2D_SensitiveCurve)
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
DEFINE_STANDARD_RTTI(ISession2D_SensitiveCurve)
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
Standard_Real myCDeflect;
Standard_Integer myMaxRect;
Handle(Geom2d_Curve) myCurve;
Standard_Real myCDeflect;
Standard_Integer myMaxRect;
Handle(Geom2d_Curve) myCurve;
Handle(TColgp_HArray1OfPnt2d) myPolyP2d;
};
@@ -102,8 +83,4 @@ inline Handle(Geom2d_Curve) ISession2D_SensitiveCurve::
GetCurve()
{return myCurve;}
// other inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@@ -9,9 +9,6 @@
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject)
#include "StdPrs_Curve.hxx"
#include "GeomAdaptor_Curve.hxx"
#include "StdPrs_PoleCurve.hxx"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;

View File

@@ -16,16 +16,18 @@ DEFINE_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
class ISession_Curve : public AIS_InteractiveObject
{
public:
ISession_Curve(Handle(Geom_Curve)& aCurve);
virtual ~ISession_Curve();
DEFINE_STANDARD_RTTI(ISession_Curve)
ISession_Curve(Handle(Geom_Curve)& aCurve);
virtual ~ISession_Curve();
DEFINE_STANDARD_RTTI(ISession_Curve)
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Handle(Geom_Curve) myCurve;
Handle(Geom_Curve) myCurve;
};
#endif // !defined(AFX_ISESSION_CURVE_H__F981CB93_A3CC_11D1_8DA3_0800369C8A03__INCLUDED_)

View File

@@ -14,11 +14,6 @@ static char THIS_FILE[]=__FILE__;
IMPLEMENT_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
#include "Graphic2d_SetOfSegments.hxx"
#include "gp_Vec2d.hxx"
#include "DsgPrs_LengthPresentation.hxx"
#include "Prs3d_ArrowAspect.hxx"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -84,31 +79,6 @@ void ISession_Direction::Compute(const Handle(Prs3d_Projector)& aProjector,
{
}
void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer aMode)
{
Handle(Graphic2d_SetOfSegments) segment;
segment = new Graphic2d_SetOfSegments(aGrObj);
segment->Add(myPnt.X(),
myPnt.Y(),
myPnt.X()+myLength*myDir.X(),
myPnt.Y()+myLength*myDir.Y());
gp_Dir2d aFirstDir = gp_Dir2d(myDir.X(),myDir.Y()).Rotated (200*M_PI/180) ;
segment->Add(myPnt.X()+myLength*myDir.X(),
myPnt.Y()+myLength*myDir.Y(),
myPnt.X()+myLength*myDir.X()+ myLength*aFirstDir.X()/5 ,
myPnt.Y()+myLength*myDir.Y()+ myLength*aFirstDir.Y()/5 );
gp_Dir2d aSecondDir = gp_Dir2d(myDir.X(),myDir.Y()).Rotated (-200*M_PI/180) ;
segment->Add(myPnt.X()+myLength*myDir.X(),
myPnt.Y()+myLength*myDir.Y(),
myPnt.X()+myLength*myDir.X()+ myLength*aSecondDir.X()/5 ,
myPnt.Y()+myLength*myDir.Y()+ myLength*aSecondDir.Y()/5 );
}
void ISession_Direction::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
{

View File

@@ -14,17 +14,17 @@ DEFINE_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
class ISession_Direction : public AIS_InteractiveObject
{
public:
TCollection_ExtendedString myText;
void SetText(TCollection_ExtendedString& aText);
ISession_Direction();
ISession_Direction(gp_Pnt& aPnt,gp_Dir& aDir,Standard_Real aLength=1,Standard_Real anArrowLength=1);
ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec,Standard_Real anArrowLength=1);
TCollection_ExtendedString myText;
void SetText(TCollection_ExtendedString& aText);
ISession_Direction();
ISession_Direction(gp_Pnt& aPnt,gp_Dir& aDir,Standard_Real aLength=1,Standard_Real anArrowLength=1);
ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec,Standard_Real anArrowLength=1);
ISession_Direction(gp_Pnt2d& aPnt2d,gp_Dir2d& aDir2d,Standard_Real aLength=1);
ISession_Direction(gp_Pnt2d& aPnt2d,gp_Vec2d& aVec2d);
ISession_Direction(gp_Pnt2d& aPnt2d,gp_Dir2d& aDir2d,Standard_Real aLength=1);
ISession_Direction(gp_Pnt2d& aPnt2d,gp_Vec2d& aVec2d);
virtual ~ISession_Direction();
DEFINE_STANDARD_RTTI(ISession_Direction)
virtual ~ISession_Direction();
DEFINE_STANDARD_RTTI(ISession_Direction)
private:
@@ -33,9 +33,6 @@ private:
const Standard_Integer aMode);
void Compute (const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation) ;
virtual void Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer aMode = 0) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
gp_Pnt myPnt;

View File

@@ -14,9 +14,6 @@ static char THIS_FILE[]=__FILE__;
IMPLEMENT_STANDARD_HANDLE(ISession_Point,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Point,AIS_InteractiveObject)
#include "Graphic2d_CircleMarker.hxx"
#include "StdPrs_Point.hxx"
#include "Geom_CartesianPoint.hxx"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -58,14 +55,6 @@ void ISession_Point::Compute(const Handle(Prs3d_Projector)& aProjector,
{
}
void ISession_Point::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer unMode)
{
Handle(Graphic2d_CircleMarker) aCircleMarker;
aCircleMarker = new Graphic2d_CircleMarker(aGrObj,myPoint.X(),myPoint.Y(),0,0,1);
}
void ISession_Point::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode)
{

View File

@@ -17,28 +17,25 @@ DEFINE_STANDARD_HANDLE(ISession_Point,AIS_InteractiveObject)
class ISession_Point : public AIS_InteractiveObject
{
public:
ISession_Point();
ISession_Point(Standard_Real X,Standard_Real Y ,Standard_Real Z);
ISession_Point(gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
ISession_Point(gp_Pnt& aPoint);
virtual ~ISession_Point();
DEFINE_STANDARD_RTTI(ISession_Point)
ISession_Point();
ISession_Point(Standard_Real X,Standard_Real Y ,Standard_Real Z);
ISession_Point(gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
ISession_Point(gp_Pnt& aPoint);
virtual ~ISession_Point();
DEFINE_STANDARD_RTTI(ISession_Point)
private :
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
void Compute (const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation) ;
void Compute (const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer unMode = 0) ;
void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode) ;
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
void Compute (const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation);
gp_Pnt myPoint;
void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode);
gp_Pnt myPoint;
};

View File

@@ -14,15 +14,6 @@ static char THIS_FILE[]=__FILE__;
IMPLEMENT_STANDARD_HANDLE(ISession_Surface,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Surface,AIS_InteractiveObject)
#include "GeomAdaptor_Surface.hxx"
#include "StdPrs_WFSurface.hxx"
#include "StdPrs_WFPoleSurface.hxx"
#include "GeomAdaptor_HSurface.hxx"
#include "AIS_Drawer.hxx"
#include "Prs3d_IsoAspect.hxx"
#include "StdPrs_WFDeflectionShape.hxx"
#include "StdPrs_ShadedSurface.hxx"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

View File

@@ -23,9 +23,9 @@ public:
DEFINE_STANDARD_RTTI(ISession_Surface)
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0);
Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation);
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode);
Handle(Geom_Surface) mySurface;

View File

@@ -14,20 +14,6 @@ static char THIS_FILE[]=__FILE__;
IMPLEMENT_STANDARD_HANDLE(ISession_Text,AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(ISession_Text,AIS_InteractiveObject)
#include <Graphic2d_Text.hxx>
#include <Select2D_SensitiveBox.hxx>
#include <Graphic2d_Segment.hxx>
#include <OSD_Environment.hxx>
#include <Graphic2d_View.hxx>
#include <Graphic2d_Drawer.hxx>
#include "PrsMgr_PresentationManager2d.hxx"
#include "SelectMgr_Selection.hxx"
#include "Graphic2d_Array1OfVertex.hxx"
#include "Graphic2d_Polyline.hxx"
#include "Graphic2d_Vertex.hxx"
#include "Graphic2d_DisplayList.hxx"
#include "Prs3d_Text.hxx"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -37,7 +23,6 @@ ISession_Text::ISession_Text()
}
ISession_Text::ISession_Text
(const TCollection_AsciiString& aText,
const Standard_Real anX , // = 0
@@ -52,7 +37,9 @@ ISession_Text::ISession_Text
:AIS_InteractiveObject(),MyText(aText),MyX(anX),MyY(anY),MyZ(aZ),
MyTypeOfText(aType),MyAngle(anAngle),MySlant(aslant),MyFontIndex(aFontIndex),
MyColorIndex(aColorIndex),MyScale(aScale),MyWidth(0),MyHeight(0)
{}
{
}
ISession_Text::ISession_Text
(const TCollection_AsciiString& aText,
@@ -66,9 +53,9 @@ ISession_Text::ISession_Text
:AIS_InteractiveObject(),MyText(aText),MyX(aPoint.X()),MyY(aPoint.Y()),MyZ(aPoint.Z()),
MyTypeOfText(aType),MyAngle(anAngle),MySlant(aslant),MyFontIndex(aFontIndex),
MyColorIndex(aColorIndex),MyScale(aScale),MyWidth(0),MyHeight(0)
{}
{
}
ISession_Text::~ISession_Text()
{
@@ -87,25 +74,6 @@ void ISession_Text::Compute(const Handle(Prs3d_Projector)& aProjector,
{
}
void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer unMode)
{
Handle(Graphic2d_Text) text;
text = new Graphic2d_Text(aGrObj, MyText, MyX, MyY, MyAngle,MyTypeOfText,MyScale);
text->SetFontIndex(MyFontIndex);
text->SetColorIndex(MyColorIndex);
text->SetSlant(MySlant);
text->SetUnderline(Standard_False);
text->SetZoomable(Standard_True);
aGrObj->Display();
Quantity_Length anXoffset,anYoffset;
text->TextSize(MyWidth, MyHeight,anXoffset,anYoffset);
}
void ISession_Text::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode)
{

View File

@@ -11,24 +11,20 @@
#include <Standard_Macro.hxx>
#include <Standard_DefineHandle.hxx>
#include <TCollection_AsciiString.hxx>
#include <Aspect_TypeOfText.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Quantity_Factor.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Handle_PrsMgr_PresentationManager2d.hxx>
#include <Handle_Graphic2d_GraphicObject.hxx>
#include <Handle_SelectMgr_Selection.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Standard_CString.hxx>
#include <SelectMgr_SelectableObject.hxx>
class TCollection_AsciiString;
class PrsMgr_PresentationManager2d;
class Graphic2d_GraphicObject;
class SelectMgr_Selection;
DEFINE_STANDARD_HANDLE(ISession_Text,AIS_InteractiveObject)
@@ -80,32 +76,15 @@ inline void SetScale (const Quantity_Factor aNewScale) ;
DEFINE_STANDARD_RTTI(ISession_Text)
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
void Compute (const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation);
void Compute (const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer unMode = 0) ;
void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode) ;
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
void Compute (const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation);
void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode) ;
// Fields PRIVATE

View File

@@ -18,17 +18,17 @@ static char THIS_FILE[] = __FILE__;
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
@@ -36,8 +36,6 @@ static UINT indicators[] =
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
@@ -46,58 +44,57 @@ CMainFrame::~CMainFrame()
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndToolBar2.Create(this) ||
!m_wndToolBar2.LoadToolBar(IDR_MAINFRAME2))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndToolBar2.Create(this) ||
!m_wndToolBar2.LoadToolBar(IDR_MAINFRAME2))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar2.SetBarStyle(m_wndToolBar2.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar2);
return 0;
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar2.SetBarStyle(m_wndToolBar2.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar2);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CMDIFrameWnd::PreCreateWindow(cs);
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CMDIFrameWnd::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
@@ -106,12 +103,12 @@ BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG

View File

@@ -11,41 +11,39 @@
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
CMainFrame();
// Attributes
// Attributes
public:
// Operations
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Overrides
// ClassWizard generated virtual function overrides
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// Implementation
// Implementation
public:
virtual ~CMainFrame();
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CToolBar m_wndToolBar2;
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CToolBar m_wndToolBar2;
// Generated message map functions
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

View File

@@ -83,181 +83,193 @@
#include <AIS_InteractiveContext.hxx>
#include <AIS_Shape.hxx>
//#include <AIS_Trihedron.hxx>
#include <AIS_Point.hxx>
#include <AIS_Drawer.hxx>
#include <Aspect_Grid.hxx>
#include <Aspect_Window.hxx>
#include <Aspect_Background.hxx>
#include <BRepAlgo.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepTools.hxx>
#include <Graphic3d_WNTGraphicDevice.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
#include <Bnd_Box2d.hxx>
#include <BndLib.hxx>
#include <BndLib_Add2dCurve.hxx>
#include <BndLib_Add3dCurve.hxx>
#include <BndLib_AddSurface.hxx>
#include <BRep_Tool.hxx>
#include <BRepMesh.hxx>
#include <DsgPrs_LengthPresentation.hxx>
#include <FairCurve_Batten.hxx>
#include <FairCurve_MinimalVariation.hxx>
#include <GC_MakeCircle.hxx>
#include <GC_MakeTranslation.hxx>
#include <GC_MakeSegment.hxx>
#include <GC_MakeConicalSurface.hxx>
#include <GC_MakePlane.hxx>
#include <GC_MakeEllipse.hxx>
#include <GccAna_Circ2d2TanRad.hxx>
#include <GccAna_Lin2d2Tan.hxx>
#include <GccAna_Pnt2dBisec.hxx>
#include <GccEnt.hxx>
#include <GccEnt_QualifiedCirc.hxx>
#include <GccEnt_QualifiedLin.hxx>
#include <gce_MakeCirc2d.hxx>
#include <gce_MakeLin2d.hxx>
#include <GCE2d_MakeSegment.hxx>
#include <GCE2d_MakeParabola.hxx>
#include <GCE2d_MakeEllipse.hxx>
#include <GCE2d_MakeArcOfCircle.hxx>
#include <GCE2d_MakeArcOfEllipse.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <GCPnts_QuasiUniformDeflection.hxx>
#include <GCPnts_TangentialDeflection.hxx>
#include <GCPnts_UniformAbscissa.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_OffsetSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom2dAPI_ExtremaCurveCurve.hxx>
#include <Geom2dAPI_InterCurveCurve.hxx>
#include <Geom2dAPI_Interpolate.hxx>
#include <Geom2dAPI_PointsToBSpline.hxx>
#include <Geom2d_OffsetCurve.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dConvert.hxx>
#include <Geom2dLProp_Curve2dTool.hxx>
#include <Geom2dLProp_CLProps2d.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAPI.hxx>
#include <GeomAPI_ExtremaSurfaceSurface.hxx>
#include <GeomAPI_IntCS.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <GeomConvert.hxx>
#include <GeomConvert_CompBezierSurfacesToBSplineSurface.hxx>
#include <GeomFill_ConstrainedFilling.hxx>
#include <GeomFill_SimpleBound.hxx>
#include <GeomFill_FillingStyle.hxx>
#include <GeomFill_BSplineCurves.hxx>
#include <GeomFill_Pipe.hxx>
#include <GeomLib.hxx>
#include <GeomPlate_BuildPlateSurface.hxx>
#include <GeomPlate_PointConstraint.hxx>
#include <GeomPlate_MakeApprox.hxx>
#include <GeomTools.hxx>
#include <GeomTools_Curve2dSet.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Array1OfVertex.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <GProp_PEquation.hxx>
#include <gp.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Dir.hxx>
#include <gp_Elips.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Mat.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec2d.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <OSD_Environment.hxx>
#include <Poly_Triangulation.hxx>
#include <Precision.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <SelectBasics_BasicTool.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <ShapeFix_Shape.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <StdPrs_WFDeflectionShape.hxx>
#include <StdPrs_ShadedSurface.hxx>
#include <StdPrs_Point.hxx>
#include <StdPrs_WFSurface.hxx>
#include <StdPrs_WFPoleSurface.hxx>
#include <StdPrs_Curve.hxx>
#include <StdPrs_PoleCurve.hxx>
#include <Standard_ErrorHandler.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array2OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColgp_SequenceOfPnt2d.hxx>
#include <TColGeom_Array2OfBezierSurface.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS.hxx>
#include <TopoDS_ListIteratorOfListOfShape.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Builder.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
#include <WNT_Window.hxx>
#include <Standard_ErrorHandler.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS.hxx>
#include <TopExp_Explorer.hxx>
//#include <ShapeTool_Face.hxx>
//#include <ShapeTool_PCurves.hxx>
//#include <ShapeTool_Reshape.hxx>
//#include <ShapeTool_ShellSolid.hxx>
#include <TopoDS_ListIteratorOfListOfShape.hxx>
#include "WNT_WDriver.hxx"
#include "V2d_View.hxx"
#include "V2d_Viewer.hxx"
//#include "UnitsAPI.hxx"
#include "GProp_PEquation.hxx"
#include "gp.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "Geom2d_Circle.hxx"
#include "gp_Vec2d.hxx"
#include "Geom2d_Circle.hxx"
#include "Geom2dLProp_Curve2dTool.hxx"
#include "Geom2dLProp_CLProps2d.hxx"
#include "gp_Dir.hxx"
#include "Precision.hxx"
#include "GCPnts_AbscissaPoint.hxx"
#include "Geom2dAdaptor_Curve.hxx"
#include "GCPnts_UniformAbscissa.hxx"
#include "Geom_SphericalSurface.hxx"
#include "Geom_Circle.hxx"
#include "GC_MakeTranslation.hxx"
#include "Geom_Transformation.hxx"
#include "GC_MakeCircle.hxx"
#include "gp_Mat.hxx"
#include "GeomAPI_IntCS.hxx"
#include "GC_MakeSegment.hxx"
#include "GC_MakeConicalSurface.hxx"
#include "gp_Lin.hxx"
#include "Geom2d_Ellipse.hxx"
#include "GCE2d_MakeEllipse.hxx"
#include "GCE2d_MakeArcOfEllipse.hxx"
#include "TColgp_HArray1OfPnt.hxx"
#include "Geom_BSplineCurve.hxx"
#include "GeomAPI_PointsToBSpline.hxx"
#include "GeomAPI_Interpolate.hxx"
#include "GccEnt_QualifiedLin.hxx"
#include "GccAna_Circ2d2TanRad.hxx"
#include "gce_MakeCirc2d.hxx"
#include "GccEnt.hxx"
#include "GccAna_Lin2d2Tan.hxx"
#include "GccEnt_QualifiedCirc.hxx"
#include "gce_MakeLin2d.hxx"
#include "Geom2d_OffsetCurve.hxx"
#include "Geom2dAPI_InterCurveCurve.hxx"
#include "Geom2dAPI_ExtremaCurveCurve.hxx"
#include "GeomAPI.hxx"
#include "Geom2d_TrimmedCurve.hxx"
#include "GCE2d_MakeSegment.hxx"
#include "Geom2dConvert.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_HArray1OfPnt2d.hxx"
#include "gp_Parab2d.hxx"
#include "gp_Trsf.hxx"
#include "gp_Pln.hxx"
#include "gp_Elips.hxx"
#include "IntAna_IntConicQuad.hxx"
#include "GeomAPI_ProjectPointOnSurf.hxx"
#include "GeomAPI_ProjectPointOnCurve.hxx"
#include "Geom2dAPI_PointsToBSpline.hxx"
#include "Geom2dAPI_Interpolate.hxx"
#include "GccAna_Pnt2dBisec.hxx"
#include "BRepBuilderAPI_MakeVertex.hxx"
#include "BRepBuilderAPI_MakeFace.hxx"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
#include "GeomTools.hxx"
#include "TColgp_SequenceOfPnt2d.hxx"
#include "GC_MakePlane.hxx"
#include "GC_MakeEllipse.hxx"
#include "Geom_Plane.hxx"
#include "Geom2d_Line.hxx"
#include "Geom_Circle.hxx"
#include "AIS_Drawer.hxx"
#include "Prs3d_IsoAspect.hxx"
#include "GCE2d_MakeArcOfCircle.hxx"
#include "Geom_Line.hxx"
#include "Geom2d_BSplineCurve.hxx"
#include "TColgp_Array2OfPnt2d.hxx"
#include "Geom_RectangularTrimmedSurface.hxx"
#include "GeomFill_FillingStyle.hxx"
#include "GeomFill_BSplineCurves.hxx"
#include "TopoDS_Vertex.hxx"
#include "TopoDS_Shape.hxx"
#include "TopoDS_Face.hxx"
#include "GeomAdaptor_HCurve.hxx"
#include "GeomFill_SimpleBound.hxx"
#include "GeomFill_Pipe.hxx"
#include "GeomConvert.hxx"
#include "TColgp_Array2OfPnt.hxx"
#include "Geom_BezierSurface.hxx"
#include "TColGeom_Array2OfBezierSurface.hxx"
#include "GeomConvert_CompBezierSurfacesToBSplineSurface.hxx"
#include "TColStd_HArray1OfInteger.hxx"
#include "Geom_OffsetSurface.hxx"
#include "Geom_SurfaceOfLinearExtrusion.hxx"
#include "Geom_SurfaceOfRevolution.hxx"
#include "GeomLib.hxx"
#include "Geom_BSplineSurface.hxx"
#include "Geom2d_Parabola.hxx"
#include "GCE2d_MakeParabola.hxx"
#include "Geom_TrimmedCurve.hxx"
#include "GeomFill_ConstrainedFilling.hxx"
#include "Geom_Curve.hxx"
#include "Geom_Surface.hxx"
#include "BndLib_Add2dCurve.hxx"
#include "BndLib.hxx"
#include "FairCurve_Batten.hxx"
#include "FairCurve_MinimalVariation.hxx"
#include "Geom2d_Parabola.hxx"
#include "GCE2d_MakeParabola.hxx"
#include "Geom_TrimmedCurve.hxx"
#include "GeomFill_ConstrainedFilling.hxx"
#include <GeomAPI_ExtremaSurfaceSurface.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <BndLib_AddSurface.hxx>
#include <BndLib_Add3dCurve.hxx>
#include "Prs3d_TextAspect.hxx"
#include "Prs3d_ArrowAspect.hxx"
#include "Prs3d_PointAspect.hxx"
#include <BRepMesh.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <BRep_Tool.hxx>
#include <Poly_Triangulation.hxx>
#include <GeomPlate_BuildPlateSurface.hxx>
#include <GeomPlate_PointConstraint.hxx>
#include <GeomPlate_MakeApprox.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Builder.hxx>
#include <ShapeFix_Shape.hxx>
#include <AIS_Point.hxx>
#include <Geom_CartesianPoint.hxx>
#include "ISession2D_Curve.h"
#include "ISession_Direction.h"
#include "ISession2D_InteractiveContext.h"
#include "ISession_Curve.h"
#include "ISession_Surface.h"
#include "ISession_Text.h"