1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -25,15 +25,16 @@ static char THIS_FILE[] = __FILE__;
/////////////////////////////////////////////////////////////////////////////
// CHLRApp construction
CHLRApp::CHLRApp()
CHLRApp::CHLRApp() : OCC_App()
{
SampleName = "HLR"; //for about dialog
SampleName = "HLR"; //for about dialog
}
CHLRApp::~CHLRApp()
{
delete pDocTemplateForView2d;
delete pDocTemplateForView2d;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CHLRApp object
@@ -44,66 +45,65 @@ CHLRApp theApp;
BOOL CHLRApp::InitInstance()
{
AfxEnableControlContainer();
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.
// Modified by CasCade :
SetRegistryKey(_T("Local CasCade 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.
// Modified by CasCade :
SetRegistryKey(_T("Local CasCade 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.
// CasCade :
// CasCade :
pDocTemplateForView2d = new CMultiDocTemplate(
IDR_2DTYPE,
RUNTIME_CLASS(CHLRDoc),
RUNTIME_CLASS(OCC_2dChildFrame), // custom MDI child frame
RUNTIME_CLASS(CHLRView2D));
// AddDocTemplate(pDocTemplateForView2d);
pDocTemplateForView2d = new CMultiDocTemplate(
IDR_2DTYPE,
RUNTIME_CLASS(CHLRDoc),
RUNTIME_CLASS(OCC_2dChildFrame), // custom MDI child frame
RUNTIME_CLASS(CHLRView2D));
// AddDocTemplate(pDocTemplateForView2d);
// End CasCade
pDocTemplateForView3d = new CMultiDocTemplate(
IDR_3DTYPE,
RUNTIME_CLASS(CHLRDoc),
RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame
RUNTIME_CLASS(OCC_3dView));
pDocTemplateForView3d = new CMultiDocTemplate(
IDR_3DTYPE,
RUNTIME_CLASS(CHLRDoc),
RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame
RUNTIME_CLASS(OCC_3dView));
AddDocTemplate(pDocTemplateForView3d);
AddDocTemplate(pDocTemplateForView3d);
// create main MDI Frame window
OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB);
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// create main MDI Frame window
OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB);
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->MDITile(MDITILE_VERTICAL);
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
return TRUE;
// The main window has been initialized, so show and update it.
pMainFrame->MDITile(MDITILE_VERTICAL);
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////

View File

@@ -8,27 +8,27 @@
#pragma once
#endif // _MSC_VER >= 1000
#include <OCC_3dApp.h>
#include <OCC_App.h>
#include "HLRDoc.h"
//#include "CutAndPasteSession.h"
class CHLRApp : public OCC_3dApp
class CHLRApp : public OCC_App
{
public:
CHLRApp();
~CHLRApp();
virtual BOOL InitInstance();
// =========================================
CFrameWnd* CreateView2D(CHLRDoc* pDoc);
// =========================================
CFrameWnd* CreateView3D(CHLRDoc* pDoc);
// =========================================
CHLRApp();
~CHLRApp();
virtual BOOL InitInstance();
// =========================================
CFrameWnd* CreateView2D(CHLRDoc* pDoc);
// =========================================
CFrameWnd* CreateView3D(CHLRDoc* pDoc);
// =========================================
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;
};
/////////////////////////////////////////////////////////////////////////////

View File

@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "HLRDoc.h"
#include "HLRApp.h"
#include <OCC_2dView.h>
#include <OCC_3dView.h>
@@ -13,8 +12,6 @@
#include <ImportExport/ImportExport.h>
#include "AISDialogs.h"
#include "Properties/PropertiesSheet.h"
#include <AIS_ListOfInteractive.hxx>
#ifdef _DEBUG
@@ -30,12 +27,11 @@ IMPLEMENT_DYNCREATE(CHLRDoc, CDocument)
BEGIN_MESSAGE_MAP(CHLRDoc, OCC_3dBaseDoc)
//{{AFX_MSG_MAP(CHLRDoc)
ON_COMMAND(ID_WINDOW_NEW3D, OnWindowNew3d)
ON_COMMAND(ID_WINDOW_NEW2D, OnWindowNew2d)
ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep)
ON_COMMAND(ID_BUTTON_HLRDialog, OnBUTTONHLRDialog)
ON_COMMAND(ID_MENU_CASCADE_PROPERTIES, OnBUTTONTest2DProperties)
//{{AFX_MSG_MAP(CHLRDoc)
ON_COMMAND(ID_WINDOW_NEW3D, OnWindowNew3d)
ON_COMMAND(ID_WINDOW_NEW2D, OnWindowNew2d)
ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep)
ON_COMMAND(ID_BUTTON_HLRDialog, OnBUTTONHLRDialog)
//}}AFX_MSG_MAP
@@ -46,92 +42,55 @@ END_MESSAGE_MAP()
CHLRDoc::CHLRDoc()
{
// TODO: add one-time construction code here
// TODO: add one-time construction code here
Handle(Graphic3d_GraphicDriver) theGraphicDriver =
((CHLRApp*)AfxGetApp())->GetGraphicDriver();
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
((CHLRApp*)AfxGetApp())->GetGraphicDevice();
// VIEWER 3D
TCollection_ExtendedString a3DName ("Visu3D");
myViewer = new V3d_Viewer (theGraphicDriver, a3DName.ToExtString(), "", 1000.0,
V3d_XposYnegZpos, Quantity_NOC_GRAY30,
V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
Standard_True, Standard_False);
TCollection_ExtendedString a3DName("Visu3D");
myViewer = new V3d_Viewer(theGraphicDevice,a3DName.ToExtString(),"", 1000.0,
V3d_XposYnegZpos, Quantity_NOC_GRAY30,
V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT,
Standard_True, Standard_False);
/*
Handle(V3d_Viewer) myViewerCollector;
myViewerCollector = new V3d_Viewer(theGraphicDevice,a3DName.ToExtString(),"", 1000.0,
V3d_XposYnegZpos, Quantity_NOC_GRAY30,
V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT,
Standard_True, Standard_False);
*/
myViewer->SetDefaultLights();
myViewer->SetLightOn();
myViewer->SetDefaultLights();
myViewer->SetLightOn();
//myAISContext =new AIS_InteractiveContext(myViewer,myViewerCollector);
myAISContext =new AIS_InteractiveContext (myViewer);
myAISContext =new AIS_InteractiveContext(myViewer);
// 2D VIEWER: exploit V3d viewer for 2D visualization
TCollection_ExtendedString a2DName ("Visu2D");
my2DViewer = new V3d_Viewer (theGraphicDriver, a2DName.ToExtString());
my2DViewer->SetCircularGridValues (0, 0, 10, 8, 0);
my2DViewer->SetRectangularGridValues (0, 0, 10, 10, 0);
// VIEWER 2D
TCollection_ExtendedString a2DName("Visu2D");
my2DViewer = new V2d_Viewer(theGraphicDevice,a2DName.ToExtString());
my2DViewer->SetCircularGridValues(0,0,10,8,0);
my2DViewer->SetRectangularGridValues(0,0,10,10,0);
myInteractiveContext2D= new ISession2D_InteractiveContext(my2DViewer);
//Set projection mode for 2D visualization
my2DViewer->SetDefaultViewProj (V3d_Zpos);
CFrameWnd* pFrame2d=((CHLRApp*)AfxGetApp())->CreateView2D(this);
pFrame2d->ShowWindow(SW_SHOWNORMAL/*SW_MINIMIZE*/);
myInteractiveContext2D = new AIS_InteractiveContext (my2DViewer);
// update the Maps :
// entries are reserve for utilisation :
// - 1 for Visible edges HighLighted
// - 2 for Visible edges
// - 3 for Hidden edges HighLighted
// - 4 for Hidden edges
Handle(Aspect_GenericColorMap) aColorMap= Handle(Aspect_GenericColorMap)::DownCast(my2DViewer->ColorMap());
ASSERT(!aColorMap.IsNull());
aColorMap->AddEntry(Aspect_ColorMapEntry (1,Quantity_Color(Quantity_NOC_RED ))); // in fact just update
aColorMap->AddEntry(Aspect_ColorMapEntry (2,Quantity_Color(Quantity_NOC_WHITE))); // in fact just update
aColorMap->AddEntry(Aspect_ColorMapEntry (3,Quantity_Color(Quantity_NOC_RED ))); // in fact just update
aColorMap->AddEntry(Aspect_ColorMapEntry (4,Quantity_Color(Quantity_NOC_BLUE1))); // in fact just update
my2DViewer->SetColorMap(aColorMap);
Handle(Aspect_WidthMap) aWidthMap = my2DViewer->WidthMap();
aWidthMap->AddEntry(Aspect_WidthMapEntry(1,0.8)); // in fact just update
aWidthMap->AddEntry(Aspect_WidthMapEntry(2,0.4)); // in fact just update
aWidthMap->AddEntry(Aspect_WidthMapEntry(3,0.6)); // in fact just update
aWidthMap->AddEntry(Aspect_WidthMapEntry(4,0.2)); // in fact just update
my2DViewer->SetWidthMap(aWidthMap);
Handle(Aspect_TypeMap) aTypeMap = my2DViewer->TypeMap();
aTypeMap->AddEntry(Aspect_TypeMapEntry(1,Aspect_LineStyle(Aspect_TOL_SOLID)));
aTypeMap->AddEntry(Aspect_TypeMapEntry(2,Aspect_LineStyle(Aspect_TOL_SOLID)));
TColQuantity_Array1OfLength anArray(1,2);
anArray(1) = 0.5; anArray(2) = 0.5;
aTypeMap->AddEntry(Aspect_TypeMapEntry(3,Aspect_LineStyle(anArray)));
aTypeMap->AddEntry(Aspect_TypeMapEntry(4,Aspect_LineStyle(anArray)));
my2DViewer->SetTypeMap(aTypeMap);
myCSelectionDialogIsCreated=false;
CFrameWnd* pFrame2d = ((CHLRApp*)AfxGetApp())->CreateView2D (this);
pFrame2d->ShowWindow (SW_SHOWNORMAL);
myCSelectionDialogIsCreated = false;
}
CHLRDoc::~CHLRDoc()
{
if (myCSelectionDialogIsCreated)
{
myCSelectionDialog->ShowWindow(SW_ERASE);
delete myCSelectionDialog;
}
if (myCSelectionDialogIsCreated)
{
myCSelectionDialog->ShowWindow(SW_ERASE);
delete myCSelectionDialog;
}
}
void CHLRDoc::OnWindowNew2d()
{
((CHLRApp*)AfxGetApp())->CreateView2D(this);
((CHLRApp*)AfxGetApp())->CreateView2D(this);
}
void CHLRDoc::OnWindowNew3d()
{
((CHLRApp*)AfxGetApp())->CreateView3D(this);
((CHLRApp*)AfxGetApp())->CreateView3D(this);
}
// nCmdShow could be : ( default is SW_RESTORE )
@@ -152,13 +111,13 @@ void CHLRDoc::ActivateFrame(CRuntimeClass* pViewClass,int nCmdShow)
while (position != (POSITION)NULL)
{
CView* pCurrentView = (CView*)GetNextView(position);
if(pCurrentView->IsKindOf(pViewClass) )
if(pCurrentView->IsKindOf(pViewClass) )
{
ASSERT_VALID(pCurrentView);
CFrameWnd* pParentFrm = pCurrentView->GetParentFrame();
ASSERT(pParentFrm != (CFrameWnd *)NULL);
// simply make the frame window visible
pParentFrm->ActivateFrame(nCmdShow);
ASSERT_VALID(pCurrentView);
CFrameWnd* pParentFrm = pCurrentView->GetParentFrame();
ASSERT(pParentFrm != (CFrameWnd *)NULL);
// simply make the frame window visible
pParentFrm->ActivateFrame(nCmdShow);
}
}
}
@@ -171,48 +130,38 @@ void CHLRDoc::FitAll2DViews(Standard_Boolean UpdateViewer)
{
CView* pCurrentView = (CView*)GetNextView(position);
if(pCurrentView->IsKindOf(RUNTIME_CLASS(OCC_2dView)) )
{
{
ASSERT_VALID(pCurrentView);
((OCC_2dView*)pCurrentView)->GetV2dView()->Fitall();
((OCC_2dView*)pCurrentView)->GetV2dView()->FitAll();
}
}
}
void CHLRDoc::OnBUTTONTest2DProperties()
{
// TODO: Add your command handler code here
CPropertiesSheet aDial;
aDial.SetViewer(my2DViewer);
aDial.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CHLRDoc diagnostics
#ifdef _DEBUG
void CHLRDoc::AssertValid() const
{
CDocument::AssertValid();
CDocument::AssertValid();
}
void CHLRDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CHLRDoc commands
void CHLRDoc::OnBUTTONHLRDialog()
{
if (!myCSelectionDialogIsCreated)
{
myCSelectionDialog = new CSelectionDialog(this,AfxGetMainWnd());
myCSelectionDialog->Create(CSelectionDialog::IDD, AfxGetMainWnd());
myCSelectionDialogIsCreated = true;
}
{
myCSelectionDialog = new CSelectionDialog(this,AfxGetMainWnd());
myCSelectionDialog->Create(CSelectionDialog::IDD, AfxGetMainWnd());
myCSelectionDialogIsCreated = true;
}
myCSelectionDialog->ShowWindow(SW_RESTORE);
}
@@ -225,10 +174,10 @@ void CHLRDoc::Fit()
POSITION position = GetFirstViewPosition();
while (position != (POSITION)NULL)
{
CView* pCurrentView = (CView*)GetNextView(position);
if(pCurrentView->IsKindOf(RUNTIME_CLASS(OCC_3dView)) )
CView* pCurrentView = (CView*)GetNextView(position);
if(pCurrentView->IsKindOf(RUNTIME_CLASS(OCC_3dView)) )
{
((OCC_3dView *) pCurrentView)->FitAll();
((OCC_3dView *) pCurrentView)->FitAll();
}
}
}

View File

@@ -9,7 +9,6 @@
#pragma once
#endif // _MSC_VER >= 1000
#include <ISession2D/ISession2D_InteractiveContext.h>
#include "SelectionDialog.h"
#include <OCC_3dDoc.h>
@@ -18,42 +17,41 @@ class CHLRDoc : public OCC_3dBaseDoc
public:
protected: // create from serialization only
CHLRDoc();
DECLARE_DYNCREATE(CHLRDoc)
// Attributes
CHLRDoc();
DECLARE_DYNCREATE(CHLRDoc)
// Attributes
public:
// Implementation
// Implementation
public:
virtual ~CHLRDoc();
void Fit();
virtual ~CHLRDoc();
void Fit();
#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(CHLRDoc)
afx_msg void OnWindowNew3d();
afx_msg void OnWindowNew2d();
afx_msg void OnFileImportBrep();
afx_msg void OnBUTTONTest2DProperties();
afx_msg void OnBUTTONHLRDialog();
//{{AFX_MSG(CHLRDoc)
afx_msg void OnWindowNew3d();
afx_msg void OnWindowNew2d();
afx_msg void OnFileImportBrep();
afx_msg void OnBUTTONHLRDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
DECLARE_MESSAGE_MAP()
public :
void ActivateFrame(CRuntimeClass* pViewClass, int nCmdShow = SW_RESTORE );
void ActivateFrame(CRuntimeClass* pViewClass, int nCmdShow = SW_RESTORE );
private:
Handle_V2d_Viewer my2DViewer;
Handle_ISession2D_InteractiveContext myInteractiveContext2D;
Handle_V3d_Viewer my2DViewer;
Handle_AIS_InteractiveContext myInteractiveContext2D;
public :
Handle_V2d_Viewer GetViewer2D() { return my2DViewer; };
Handle_ISession2D_InteractiveContext& GetInteractiveContext2D(){ return myInteractiveContext2D; };
void FitAll2DViews(Standard_Boolean UpdateViewer=Standard_False);
Handle_V3d_Viewer GetViewer2D() { return my2DViewer; };
Handle_AIS_InteractiveContext& GetInteractiveContext2D(){ return myInteractiveContext2D; };
void FitAll2DViews(Standard_Boolean UpdateViewer=Standard_False);
public :
CSelectionDialog* myCSelectionDialog;

View File

@@ -2,9 +2,7 @@
//
#include "stdafx.h"
#include "HLRView2D.h"
#include "HLRApp.h"
#include "HLRDoc.h"
#include "resource2d\RectangularGrid.h"
@@ -33,10 +31,10 @@ static char THIS_FILE[] = __FILE__;
IMPLEMENT_DYNCREATE(CHLRView2D, OCC_2dView)
BEGIN_MESSAGE_MAP(CHLRView2D, OCC_2dView)
//{{AFX_MSG_MAP(CHLRView2D)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
//{{AFX_MSG_MAP(CHLRView2D)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -52,42 +50,38 @@ CHLRView2D::~CHLRView2D()
CHLRDoc* CHLRView2D::GetDocument() // non-debug version is inline
{
//ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_2dDoc)));
return (CHLRDoc*)m_pDocument;
//ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_2dDoc)));
return (CHLRDoc*)m_pDocument;
}
void CHLRView2D::OnInitialUpdate()
{
Handle(WNT_Window) aWNTWindow;
aWNTWindow = new WNT_Window(GetSafeHwnd(),Quantity_NOC_GRAY);
myV2dView = GetDocument()->GetViewer2D()->CreateView();
myV2dView->SetWindow(aWNTWindow);
Handle(WNT_Window) aWNTWindow;
aWNTWindow = new WNT_Window(((CHLRApp*)AfxGetApp())->GetGraphicDevice(),GetSafeHwnd());
// aWNTWindow->SetBackground(Quantity_NOC_BLACK);
Handle(WNT_WDriver) aDriver= new WNT_WDriver(aWNTWindow);
myV2dView = new V2d_View(aDriver, GetDocument()->GetViewer2D(),0,0,50);
// 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 ) ;
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CHLRView2D::DragEvent2D(const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState )
const Standard_Integer y ,
const Standard_Integer TheState )
{
}
@@ -96,7 +90,7 @@ void CHLRView2D::DragEvent2D(const Standard_Integer x ,
//
//-----------------------------------------------------------------------------------------
void CHLRView2D::InputEvent2D(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
}
@@ -104,7 +98,7 @@ void CHLRView2D::InputEvent2D(const Standard_Integer x ,
//
//-----------------------------------------------------------------------------------------
void CHLRView2D::MoveEvent2D(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
}
@@ -112,7 +106,7 @@ void CHLRView2D::MoveEvent2D(const Standard_Integer x ,
//
//-----------------------------------------------------------------------------------------
void CHLRView2D::MultiMoveEvent2D(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
}
@@ -120,8 +114,8 @@ void CHLRView2D::MultiMoveEvent2D(const Standard_Integer x ,
//
//-----------------------------------------------------------------------------------------
void CHLRView2D::MultiDragEvent2D(const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState)
const Standard_Integer y ,
const Standard_Integer TheState)
{
}
@@ -130,7 +124,7 @@ void CHLRView2D::MultiDragEvent2D(const Standard_Integer x ,
//
//-----------------------------------------------------------------------------------------
void CHLRView2D::MultiInputEvent2D(const Standard_Integer x ,
const Standard_Integer y )
const Standard_Integer y )
{
}
@@ -138,12 +132,12 @@ void CHLRView2D::MultiInputEvent2D(const Standard_Integer x ,
#ifdef _DEBUG
void CHLRView2D::AssertValid() const
{
OCC_2dView::AssertValid();
OCC_2dView::AssertValid();
}
void CHLRView2D::Dump(CDumpContext& dc) const
{
OCC_2dView::Dump(dc);
OCC_2dView::Dump(dc);
}
#endif

View File

@@ -18,49 +18,49 @@
class CHLRView2D : public OCC_2dView
{
protected: // create from serialization only
CHLRView2D();
DECLARE_DYNCREATE(CHLRView2D)
CHLRView2D();
DECLARE_DYNCREATE(CHLRView2D)
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHLRView2D)
protected:
virtual void OnInitialUpdate(); // called first time after construct
//}}AFX_VIRTUAL
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHLRView2D)
protected:
virtual void OnInitialUpdate(); // called first time after construct
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CHLRView2D();
CHLRDoc* GetDocument();
virtual void DragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState);
virtual void InputEvent2D (const Standard_Integer x ,
const Standard_Integer y );
virtual void MoveEvent2D (const Standard_Integer x ,
const Standard_Integer y );
virtual void MultiMoveEvent2D (const Standard_Integer x ,
const Standard_Integer y );
virtual void MultiDragEvent2D (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState);
virtual void MultiInputEvent2D (const Standard_Integer x ,
const Standard_Integer y );
virtual ~CHLRView2D();
CHLRDoc* GetDocument();
virtual void DragEvent2D (const Standard_Integer x,
const Standard_Integer y,
const Standard_Integer TheState);
virtual void InputEvent2D (const Standard_Integer x,
const Standard_Integer y);
virtual void MoveEvent2D (const Standard_Integer x,
const Standard_Integer y );
virtual void MultiMoveEvent2D (const Standard_Integer x,
const Standard_Integer y );
virtual void MultiDragEvent2D (const Standard_Integer x,
const Standard_Integer y ,
const Standard_Integer TheState);
virtual void MultiInputEvent2D (const Standard_Integer x,
const Standard_Integer y );
#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
protected:
//{{AFX_MSG(CHLRView2D)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CHLRView2D)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1,70 +0,0 @@
// ColorNewColorCubeColorMapDialog.cpp : implementation file
//
#include "stdafx.h"
#include "ColorNewColorCubeColorMapDialog.h"
#include <HLRApp.h>
#include "Aspect_ColorCubeColorMap.hxx"
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CColorNewColorCubeColorMapDialog dialog
CColorNewColorCubeColorMapDialog::CColorNewColorCubeColorMapDialog(CWnd* pParent /*=NULL*/)
: CDialog(CColorNewColorCubeColorMapDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CColorNewColorCubeColorMapDialog)
m_base_pixel = 0;
m_redmax = 7;
m_redmult = 1;
m_greenmax = 7;
m_greenmult = 8;
m_bluemax = 3;
m_bluemult = 64;
//}}AFX_DATA_INIT
}
void CColorNewColorCubeColorMapDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CColorNewColorCubeColorMapDialog)
DDX_Text(pDX, IDC_NewColorCube_EDIT_base_pixel, m_base_pixel);
DDX_Text(pDX, IDC_NewColorCube_EDIT_redmax, m_redmax);
DDX_Text(pDX, IDC_NewColorCube_EDIT_redmult, m_redmult);
DDX_Text(pDX, IDC_NewColorCube_EDIT_greenmax, m_greenmax);
DDX_Text(pDX, IDC_NewColorCube_EDIT_grennmult, m_greenmult);
DDX_Text(pDX, IDC_NewColorCube_EDIT_bluemax, m_bluemax);
DDX_Text(pDX, IDC_NewColorCube_EDIT_bluemult, m_bluemult);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CColorNewColorCubeColorMapDialog, CDialog)
//{{AFX_MSG_MAP(CColorNewColorCubeColorMapDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColorNewColorCubeColorMapDialog message handlers
void CColorNewColorCubeColorMapDialog::OnOK()
{
UpdateData(true);
myColorMap =
new Aspect_ColorCubeColorMap(m_base_pixel,
m_redmax ,
m_redmult ,
m_greenmax ,
m_greenmult ,
m_bluemax ,
m_bluemult );
CDialog::OnOK();
}

View File

@@ -1,59 +0,0 @@
// ColorNewColorCubeColorMapDialog.h : header file
//
#if !defined(AFX_COLORNEWCOLORCUBECOLORMAPDIALOG_H__67E9AE93_D9F9_11D1_8DE3_0800369C8A03__INCLUDED_)
#define AFX_COLORNEWCOLORCUBECOLORMAPDIALOG_H__67E9AE93_D9F9_11D1_8DE3_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Aspect_ColorMap.hxx"
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// CColorNewColorCubeColorMapDialog dialog
class CColorNewColorCubeColorMapDialog : public CDialog
{
private :
Handle(Aspect_ColorMap) myColorMap;
// Construction
public:
CColorNewColorCubeColorMapDialog(CWnd* pParent = NULL); // standard constructor
Handle(Aspect_ColorMap) ColorMap() {return myColorMap;};
// Dialog Data
//{{AFX_DATA(CColorNewColorCubeColorMapDialog)
enum { IDD = IDD_DIALOG_NewColorCube };
int m_base_pixel;
int m_redmax;
int m_redmult;
int m_greenmax;
int m_greenmult;
int m_bluemax;
int m_bluemult;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColorNewColorCubeColorMapDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CColorNewColorCubeColorMapDialog)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_COLORNEWCOLORCUBECOLORMAPDIALOG_H__67E9AE93_D9F9_11D1_8DE3_0800369C8A03__INCLUDED_)

View File

@@ -1,151 +0,0 @@
// ColorNewColorRampColorMapDialog.cpp : implementation file
//
#include "stdafx.h"
#include "ColorNewColorRampColorMapDialog.h"
#include "HLRApp.h"
#include "Quantity_Color.hxx"
#include "Aspect_ColorRampColorMap.hxx"
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CColorNewColorRampColorMapDialog dialog
CColorNewColorRampColorMapDialog::CColorNewColorRampColorMapDialog(CWnd* pParent /*=NULL*/)
: CDialog(CColorNewColorRampColorMapDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CColorNewColorRampColorMapDialog)
m_base_pixel = 0;
m_dimension = 16;
m_Red = 1.0;
m_Green = 0.0;
m_Blue = 0.0;
//}}AFX_DATA_INIT
}
void CColorNewColorRampColorMapDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CColorNewColorRampColorMapDialog)
DDX_Control(pDX, IDC_NewColorMap_COMBO_NewEntryColorName, m_ColorList);
DDX_Text(pDX, IDC_NewColorRamp_EDIT_base_pixel, m_base_pixel);
DDX_Text(pDX, IDC_NewColorramp_EDIT_dimension, m_dimension);
DDX_Text(pDX, IDC_NewColorMapRamp_EDIT_ColorRed, m_Red);
DDX_Text(pDX, IDC_NewColorMapRamp_EDIT_ColorGreen, m_Green);
DDX_Text(pDX, IDC_NewColorMapRamp_EDIT_ColorBlue, m_Blue);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CColorNewColorRampColorMapDialog, CDialog)
//{{AFX_MSG_MAP(CColorNewColorRampColorMapDialog)
ON_BN_CLICKED(IDC_NewColorMapRamp_BUTTON_EditColor, OnColorMapRampBUTTONEditColor)
ON_EN_CHANGE(IDC_NewColorMapRamp_EDIT_ColorRed, OnChangeColorMapRampEDITColorRed)
ON_EN_CHANGE(IDC_NewColorMapRamp_EDIT_ColorGreen, OnChangeColorMapRampEDITColorGreen)
ON_EN_CHANGE(IDC_NewColorMapRamp_EDIT_ColorBlue, OnChangeColorMapRampEDITColorBlue)
ON_CBN_SELCHANGE(IDC_NewColorMap_COMBO_NewEntryColorName, OnSelchangeColorMapCOMBONewEntryColorName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColorNewColorRampColorMapDialog message handlers
BOOL CColorNewColorRampColorMapDialog::OnInitDialog()
{
CDialog::OnInitDialog();
for (int i = 0 ;i< 517 ; i++)
{
Standard_CString TheColorName = Quantity_Color::StringName((Quantity_NameOfColor)i);
// update the CComboBox to add the enumeration possibilities.
m_ColorList.AddString( TheColorName );
}
Quantity_Color aColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB);
m_ColorList.SetCurSel(aColor.Name());
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CColorNewColorRampColorMapDialog::OnColorMapRampBUTTONEditColor()
{
UpdateData(true);
COLORREF m_clr ;
m_clr = RGB(m_Red*255,m_Green*255,m_Blue*255);
CColorDialog dlgColor(m_clr);
if (dlgColor.DoModal() == IDOK)
{
m_clr = dlgColor.GetColor();
m_Red = GetRValue(m_clr)/255.;
m_Green = GetGValue(m_clr)/255.;
m_Blue = GetBValue(m_clr)/255.;
}
Quantity_Color aColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB);
m_ColorList.SetCurSel(aColor.Name());
UpdateData(false);
}
void CColorNewColorRampColorMapDialog::OnChangeColorMapRampEDITColorRed()
{
UpdateData(true);
if (m_Red<0) m_Red=0;
if (m_Red>1) m_Red=1;
Quantity_Color aColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB);
m_ColorList.SetCurSel(aColor.Name());
UpdateData(false);
}
void CColorNewColorRampColorMapDialog::OnChangeColorMapRampEDITColorGreen()
{
UpdateData(true);
if (m_Green<0) m_Green=0;
if (m_Green>1) m_Green=1;
Quantity_Color aColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB);
m_ColorList.SetCurSel(aColor.Name());
UpdateData(false);
}
void CColorNewColorRampColorMapDialog::OnChangeColorMapRampEDITColorBlue()
{
UpdateData(true);
if (m_Blue<0) m_Blue=0;
if (m_Blue>1) m_Blue=1;
Quantity_Color aColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB);
m_ColorList.SetCurSel(aColor.Name());
UpdateData(false);
}
void CColorNewColorRampColorMapDialog::OnSelchangeColorMapCOMBONewEntryColorName()
{
// TODO: Add your control notification handler code here
UpdateData(true);
int CurSel = m_ColorList.GetCurSel();
Quantity_NameOfColor SelectedNameOfColor = (Quantity_NameOfColor)CurSel;
Quantity_Color TheSelectedEquivalentColor(SelectedNameOfColor);
Quantity_Parameter Red,Green,Blue;
TheSelectedEquivalentColor.Values(Red,Green,Blue,Quantity_TOC_RGB);
m_Red = Red;
m_Green = Green;
m_Blue = Blue;
UpdateData(false);
}
void CColorNewColorRampColorMapDialog::OnOK()
{
UpdateData(true);
Quantity_Color TheColor(m_Red,m_Green,m_Blue,Quantity_TOC_RGB);
myColorMap =
new Aspect_ColorRampColorMap(m_base_pixel,
m_dimension,
TheColor );
CDialog::OnOK();
}

View File

@@ -1,294 +0,0 @@
// ColorPropertyPage.cpp : implementation file
//
#include "stdafx.h"
#include "ColorPropertyPage.h"
#include "HLRApp.h"
#include "ColorNewColorCubeColorMapDialog.h"
#include "ColorNewColorRampColorMapDialog.h"
#include "Aspect_ColorMapEntry.hxx"
#include "V2d_DefaultMap.hxx"
#include "Aspect_GenericColorMap.hxx"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CColorPropertyPage property page
IMPLEMENT_DYNCREATE(CColorPropertyPage, CPropertyPage)
CColorPropertyPage::CColorPropertyPage()
: CPropertyPage(CColorPropertyPage::IDD)
{
//{{AFX_DATA_INIT(CColorPropertyPage)
m_ColorMapSize = _T("Computing...");
m_ColorMapType = _T("Computing...");
m_CurrentEntryRed = _T("9.999");
m_CurrentEntryGreen = _T("9.999");
m_CurrentEntryBlue = _T("9.999");
m_NearsetColorName = _T("Computing...");
m_NewEntryRed = 9.999;
m_NewEntryBlue = 9.999;
m_NewEntryGreen = 9.999;
//}}AFX_DATA_INIT
}
BOOL CColorPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
for (int i = 0 ;i< 517 ; i++)
{
Standard_CString TheColorName = Quantity_Color::StringName((Quantity_NameOfColor)i);
// update the CComboBox to add the enumeration possibilities.
m_NewEntryColorNameCtrl.AddString( TheColorName );
}
m_NewEntryColorNameCtrl.SetCurSel(1);
// TODO: Add extra initialization here
UpdateDisplay(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
CColorPropertyPage::~CColorPropertyPage()
{
}
void CColorPropertyPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CColorPropertyPage)
DDX_Control(pDX, IDC_ColorMap_COMBO_NewEntryColorName , m_NewEntryColorNameCtrl );
DDX_Control(pDX, IDC_ColorMap_TAB , m_TabCtrl );
DDX_Text (pDX, IDC_ColorMap_STATIC_Size , m_ColorMapSize );
DDX_Text (pDX, IDC_ColorMap_STATIC_Type , m_ColorMapType );
DDX_Text (pDX, IDC_ColorMap_STATIC_EntryColorRed , m_CurrentEntryRed );
DDX_Text (pDX, IDC_ColorMap_STATIC_EntryColorGreen , m_CurrentEntryGreen );
DDX_Text (pDX, IDC_ColorMap_STATIC_EntryColorBlue , m_CurrentEntryBlue );
DDX_Text (pDX, IDC_ColorMap_STATIC_EntryColorName , m_NearsetColorName );
DDX_Text (pDX, IDC_ColorMap_EDIT_NewEntryColorRed , m_NewEntryRed );
DDX_Text (pDX, IDC_ColorMap_EDIT_NewEntryColorBlue , m_NewEntryBlue );
DDX_Text (pDX, IDC_ColorMap_EDIT_NewEntryColorGreen , m_NewEntryGreen );
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CColorPropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CColorPropertyPage)
ON_NOTIFY(TCN_SELCHANGE, IDC_ColorMap_TAB, OnSelchangeColorMapTAB)
ON_CBN_SELCHANGE(IDC_ColorMap_COMBO_NewEntryColorName, OnSelchangeColorMapCOMBONewEntryColorName)
ON_BN_CLICKED(IDC_ColorMap_BUTTON_UpdateCurrentEntry, OnColorMapBUTTONUpdateCurrentEntry)
ON_BN_CLICKED(IDC_ColorMap_BUTTON_NewColorCubeColorMap, OnColorMapBUTTONNewColorCubeColorMap)
ON_BN_CLICKED(IDC_ColorMap_BUTTON_NewGenericColorMap, OnColorMapBUTTONNewGenericColorMap)
ON_BN_CLICKED(IDC_ColorMap_BUTTON_NewColorRampColorMap, OnColorMapBUTTONNewColorRampColorMap)
ON_BN_CLICKED(IDC_ColorMap_BUTTON_NewEntry_EditColor, OnColorMapBUTTONNewEntryEditColor)
ON_BN_CLICKED(IDC_ColorMap_BUTTON_AddNewEntry, OnColorMapBUTTONAddNewEntry)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CColorPropertyPage::UpdateDisplay(int CurrentSelectionIndex)
{
Aspect_TypeOfColorMap aColorMapType = myColorMap->Type();
switch (aColorMapType) {
case Aspect_TOC_Generic : m_ColorMapType = _T("Generic"); ; break;
case Aspect_TOC_ColorCube : m_ColorMapType = _T("ColorCube"); break;
case Aspect_TOC_ColorRamp : m_ColorMapType = _T("ColorRamp"); break;
default : cout<<" Underknown";
}
int ShowOrHide;
if (aColorMapType == Aspect_TOC_Generic)
{
ShowOrHide = SW_SHOW;
GetDlgItem(IDC_ColorMap_STATIC_NewEntryNotavailable)->ShowWindow(SW_HIDE);
}
else
{
ShowOrHide = SW_HIDE;
GetDlgItem(IDC_ColorMap_STATIC_NewEntryNotavailable)->ShowWindow(SW_SHOW);
}
GetDlgItem(IDC_ColorMap_EDIT_NewEntryColorRed)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_EDIT_NewEntryColorGreen)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_EDIT_NewEntryColorBlue)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_COMBO_NewEntryColorName)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_BUTTON_NewEntry_EditColor)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_BUTTON_UpdateCurrentEntry)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_BUTTON_AddNewEntry)->ShowWindow(ShowOrHide);
GetDlgItem(IDC_ColorMap_STATIC_NewEntryColorNameStatic)->ShowWindow(ShowOrHide);
TCollection_AsciiString SizeMessage(myColorMap->Size());
m_ColorMapSize = _T(SizeMessage.ToCString());
// clear the Tab Ctrl
m_TabCtrl.DeleteAllItems();
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
for(int i =0;i<myColorMap->Size();i++) // not <=ColorMapSize, I've enter a CSR
{
Aspect_ColorMapEntry aColorMapEntry = myColorMap->FindEntry(i);
TCollection_AsciiString EntryNumerMessage(aColorMapEntry.Index());
TabCtrlItem.pszText = (LPSTR) EntryNumerMessage.ToCString();
m_TabCtrl.InsertItem( aColorMapEntry.Index(), &TabCtrlItem );
}
m_TabCtrl.SetCurSel(CurrentSelectionIndex);
// update The Current Selected entry
Aspect_ColorMapEntry aColorMapEntry = myColorMap->FindEntry(CurrentSelectionIndex);
if (aColorMapEntry. IsAllocated () )
{
Quantity_Color TheColor = aColorMapEntry.Color();
Quantity_Parameter Red,Green,Blue;
TheColor.Values(Red,Green,Blue,Quantity_TOC_RGB);
TCollection_AsciiString Message;
Message = Red;
m_CurrentEntryRed = _T(Message.ToCString());
m_NewEntryRed = Red;
Message = Green;
m_CurrentEntryGreen = _T(Message.ToCString());
m_NewEntryGreen = Green;
Message = Blue;
m_CurrentEntryBlue = _T(Message.ToCString());
m_NewEntryBlue = Blue;
Standard_CString StringName = Quantity_Color::StringName(TheColor.Name());
m_NearsetColorName = StringName;
cout<<"StringName : "<<TheColor.Name()<<endl;
m_NewEntryColorNameCtrl.SetCurSel(TheColor.Name());
if (aColorMapType == Aspect_TOC_Generic)
if (m_TabCtrl.GetCurSel() == 0)
GetDlgItem(IDC_ColorMap_BUTTON_UpdateCurrentEntry)->ShowWindow(SW_HIDE);
else
GetDlgItem(IDC_ColorMap_BUTTON_UpdateCurrentEntry)->ShowWindow(SW_SHOW);
}
else
{
m_NearsetColorName = _T("Not Allocated");
m_CurrentEntryRed = _T("9.999");
m_NewEntryRed = 9.999;
m_CurrentEntryGreen = _T("9.999");
m_NewEntryGreen = 9.999;
m_CurrentEntryBlue = _T("9.999");
m_NewEntryBlue = 9.999;
GetDlgItem(IDC_ColorMap_BUTTON_UpdateCurrentEntry)->ShowWindow(SW_HIDE);
}
UpdateData(false);
}
void CColorPropertyPage::OnColorMapBUTTONNewGenericColorMap()
{
// TODO: Add your control notification handler code here
myColorMap = V2d_DefaultMap::ColorMap();
SetModified(true);
UpdateDisplay(1);
}
void CColorPropertyPage::OnColorMapBUTTONNewColorCubeColorMap()
{
CColorNewColorCubeColorMapDialog aDlg(NULL);
if (aDlg.DoModal() == IDOK)
{
myColorMap = aDlg.ColorMap();
SetModified(true);
UpdateDisplay(1);
}
}
void CColorPropertyPage::OnColorMapBUTTONNewColorRampColorMap()
{
CColorNewColorRampColorMapDialog aDlg(NULL);
if (aDlg.DoModal() == IDOK)
{
myColorMap = aDlg.ColorMap();
SetModified(true);
UpdateDisplay(1);
}
}
/////////////////////////////////////////////////////////////////////////////
// CColorPropertyPage message handlers
void CColorPropertyPage::OnSelchangeColorMapTAB(NMHDR* pNMHDR, LRESULT* pResult)
{
UpdateDisplay(m_TabCtrl.GetCurSel());
*pResult = 0;
}
void CColorPropertyPage::OnSelchangeColorMapCOMBONewEntryColorName()
{
UpdateData(true);
int CurSel = m_NewEntryColorNameCtrl.GetCurSel();
Quantity_NameOfColor SelectedNameOfColor = (Quantity_NameOfColor)CurSel;
Quantity_Color TheSelectedEquivalentColor(SelectedNameOfColor);
Quantity_Parameter Red,Green,Blue;
TheSelectedEquivalentColor.Values(Red,Green,Blue,Quantity_TOC_RGB);
m_NewEntryRed = Red;
m_NewEntryGreen = Green;
m_NewEntryBlue = Blue;
UpdateData(false);
}
void CColorPropertyPage::OnColorMapBUTTONNewEntryEditColor()
{
int CurrentSelectedItem = m_TabCtrl.GetCurSel();
COLORREF m_clr ;
m_clr = RGB(m_NewEntryRed*255,m_NewEntryGreen*255,m_NewEntryBlue*255);
CColorDialog dlgColor(m_clr);
if (dlgColor.DoModal() == IDOK)
{
SetModified(TRUE);
m_clr = dlgColor.GetColor();
m_NewEntryRed = GetRValue(m_clr)/255.;
m_NewEntryGreen = GetGValue(m_clr)/255.;
m_NewEntryBlue = GetBValue(m_clr)/255.;
}
Quantity_Color aColor(m_NewEntryRed,m_NewEntryGreen,m_NewEntryBlue,Quantity_TOC_RGB);
m_NewEntryColorNameCtrl.SetCurSel(aColor.Name());
UpdateData(false);
}
void CColorPropertyPage::OnColorMapBUTTONUpdateCurrentEntry()
{
UpdateData(true);
Handle(Aspect_GenericColorMap) aGenericColorMap = Handle(Aspect_GenericColorMap)::DownCast(myColorMap);
if (aGenericColorMap.IsNull())
Standard_Failure::Raise(" couldn't update a none Generic Color Map");
Aspect_ColorMapEntry aColorMapEntry = myColorMap->FindEntry( m_TabCtrl.GetCurSel());
Quantity_Color aColor(m_NewEntryRed,m_NewEntryGreen,m_NewEntryBlue,Quantity_TOC_RGB);
aColorMapEntry.SetColor(aColor);
aGenericColorMap->AddEntry(aColorMapEntry); // in fact just update
SetModified(true);
UpdateData(true);
UpdateDisplay(m_TabCtrl.GetCurSel());
}
void CColorPropertyPage::OnColorMapBUTTONAddNewEntry()
{
UpdateData(true);
Quantity_Color aColor(m_NewEntryRed,m_NewEntryGreen,m_NewEntryBlue,Quantity_TOC_RGB);
Handle(Aspect_GenericColorMap) aGenericColorMap = Handle(Aspect_GenericColorMap)::DownCast(myColorMap);
if (aGenericColorMap.IsNull())
Standard_Failure::Raise(" couldn't update a none Generic Color Map");
int NewEntry = aGenericColorMap->AddEntry(aColor);
SetModified(true);
UpdateDisplay(NewEntry);
UpdateData(false);
}
BOOL CColorPropertyPage::OnApply()
{
myViewer->SetColorMap(myColorMap);
myViewer->Update();
return CPropertyPage::OnApply();
}

View File

@@ -1,86 +0,0 @@
// ColorPropertyPage.h : header file
//
#if !defined(AFX_ColorPropertyPage_H__A815F7A3_D51B_11D1_8DDE_0800369C8A03__INCLUDED_)
#define AFX_ColorPropertyPage_H__A815F7A3_D51B_11D1_8DDE_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Aspect_ColorMap.hxx"
#include <resource.h>
/////////////////////////////////////////////////////////////////////////////
// CColorPropertyPage dialog
class CColorPropertyPage : public CPropertyPage
{
DECLARE_DYNCREATE(CColorPropertyPage)
private :
Handle(Aspect_ColorMap) myColorMap;
private :
Handle(V2d_Viewer) myViewer;
public:
void SetViewer(Handle(V2d_Viewer) aViewer) {
myViewer = aViewer;
myColorMap = aViewer->ColorMap();
};
// Construction
public:
CColorPropertyPage();
~CColorPropertyPage();
// Dialog Data
//{{AFX_DATA(CColorPropertyPage)
enum { IDD = IDD_DIALOG_Color };
CComboBox m_NewEntryColorNameCtrl;
CTabCtrl m_TabCtrl;
CString m_ColorMapSize ;
CString m_ColorMapType ;
CString m_CurrentEntryRed;
CString m_CurrentEntryGreen;
CString m_CurrentEntryBlue;
CString m_NearsetColorName;
double m_NewEntryRed;
double m_NewEntryBlue;
double m_NewEntryGreen;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CColorPropertyPage)
public:
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CColorPropertyPage)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeColorMapTAB(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangeColorMapCOMBONewEntryColorName();
afx_msg void OnColorMapBUTTONUpdateCurrentEntry();
afx_msg void OnColorMapBUTTONNewColorCubeColorMap();
afx_msg void OnColorMapBUTTONNewGenericColorMap();
afx_msg void OnColorMapBUTTONNewColorRampColorMap();
afx_msg void OnColorMapBUTTONNewEntryEditColor();
afx_msg void OnColorMapBUTTONAddNewEntry();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void UpdateDisplay(int CurrentSelectionIndex);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ColorPropertyPage_H__A815F7A3_D51B_11D1_8DDE_0800369C8A03__INCLUDED_)

View File

@@ -1,275 +0,0 @@
// FontPropertyPage.cpp : implementation file
//
#include "stdafx.h"
#include "FontPropertyPage.h"
#include "HLRApp.h"
#include "Aspect_FontMapEntry.hxx"
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFontPropertyPage property page
IMPLEMENT_DYNCREATE(CFontPropertyPage, CPropertyPage)
CFontPropertyPage::CFontPropertyPage() : CPropertyPage(CFontPropertyPage::IDD)
{
//{{AFX_DATA_INIT(CFontPropertyPage)
m_FontMapSize = _T("Computing...");
m_CurrentEntryValue = _T("Computing...");
m_CurrentEntryStyle = _T("Computing...");
m_CurrentEntrySize = _T("Computing...");
m_CurrentEntrySlant = _T("Computing...");
m_NewEntryValue = _T("");
m_NewEntrySize = 1.0;
m_NewEntrySlant = 0.0;
//}}AFX_DATA_INIT
}
CFontPropertyPage::~CFontPropertyPage()
{
}
BOOL CFontPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_NewEntry_Type.AddString("DEFAULT");
m_NewEntry_Type.AddString("COURIER");
m_NewEntry_Type.AddString("HELVETICA");
m_NewEntry_Type.AddString("TIMES");
m_NewEntry_Type.AddString("USERDEFINED");
m_NewEntry_Type.SetCurSel(1);
// TODO: Add extra initialization here
UpdateDisplay(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFontPropertyPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFontPropertyPage)
DDX_Text (pDX, IDC_FontMap_STATIC_Size , m_FontMapSize );
DDX_Control(pDX, IDC_FontMap_TAB , m_TabCtrl );
DDX_Text (pDX, IDC_FontMap_STATIC_CurrentEntryValue , m_CurrentEntryValue );
DDX_Text (pDX, IDC_FontMap_STATIC_CurrentEntryType , m_CurrentEntryStyle );
DDX_Text (pDX, IDC_FontMap_STATIC_CurrentEntrySize , m_CurrentEntrySize );
DDX_Text (pDX, IDC_FontMap_STATIC_CurrentEntrySlant , m_CurrentEntrySlant );
DDX_Control(pDX, IDC_FontMap_COMBO_NewEntryType , m_NewEntry_Type );
DDX_Text(pDX, IDC_FontMap_EDIT_NewEntryValue, m_NewEntryValue);
DDX_Text(pDX, IDC_FontMap_EDIT_NewEntrySize, m_NewEntrySize);
DDX_Text(pDX, IDC_FontMap_EDIT_NewEntrySlant, m_NewEntrySlant);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFontPropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CFontPropertyPage)
ON_NOTIFY(TCN_SELCHANGE, IDC_FontMap_TAB, OnSelchangeFontMapTAB)
ON_BN_CLICKED(IDC_FontMap_BUTTON_NewEntry_EditFont, OnFontMapBUTTONNewEntryEditFont)
ON_BN_CLICKED(IDC_FontMap_BUTTON_UpdateCurrent, OnFontMapBUTTONUpdateCurrent)
ON_CBN_SELCHANGE(IDC_FontMap_COMBO_NewEntryType, OnSelchangeFontMapCOMBONewEntryType)
ON_BN_CLICKED(IDC_FontMap_BUTTON_NewEntry, OnFontMapBUTTONNewEntry)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFontPropertyPage message handlers
void CFontPropertyPage::UpdateDisplay(int CurrentSelectionIndex)
{
// Update the size of the Width map
TCollection_AsciiString SizeMessage(myFontMap->Size());
m_FontMapSize = _T(SizeMessage.ToCString());
// clear the Tab Ctrl
m_TabCtrl.DeleteAllItems();
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
for(int i =1;i<=myFontMap->Size();i++)
{
Aspect_FontMapEntry aFontMapEntry = myFontMap->Entry(i);
TCollection_AsciiString EntryNumerMessage(aFontMapEntry.Index());
TabCtrlItem.pszText = (LPSTR) EntryNumerMessage.ToCString();
m_TabCtrl.InsertItem( aFontMapEntry.Index(), &TabCtrlItem );
}
m_TabCtrl.SetCurSel(CurrentSelectionIndex-1);
// update the current Entry informations
Aspect_FontMapEntry aFontMapEntry = myFontMap->Entry(CurrentSelectionIndex);
Aspect_FontStyle TheType = aFontMapEntry.Type();
m_CurrentEntryValue = (TheType.Value() == NULL?" ":TheType.Value());
TCollection_AsciiString Message;
switch (TheType.Style())
{
case Aspect_TOF_DEFAULT : Message = "Aspect_TOF_DEFAULT"; break;
case Aspect_TOF_COURIER : Message = "Aspect_TOF_COURIER"; break;
case Aspect_TOF_HELVETICA : Message = "Aspect_TOF_HELVETICA"; break;
case Aspect_TOF_TIMES : Message = "Aspect_TOF_TIMES"; break;
case Aspect_TOF_USERDEFINED : Message = "Aspect_TOF_USERDEFINED"; break;
default: Message = "Underknown";
}
m_CurrentEntryStyle = _T(Message.ToCString());
Message = TheType.Size ();
m_CurrentEntrySize = _T(Message.ToCString());
Message = TheType.Slant ();
m_CurrentEntrySlant = _T(Message.ToCString());
// update The New Entry :
switch (TheType.Style())
{
case Aspect_TOF_DEFAULT : m_NewEntry_Type.SetCurSel(0); break;
case Aspect_TOF_COURIER : m_NewEntry_Type.SetCurSel(1); break;
case Aspect_TOF_HELVETICA : m_NewEntry_Type.SetCurSel(2); break;
case Aspect_TOF_TIMES : m_NewEntry_Type.SetCurSel(3); break;
case Aspect_TOF_USERDEFINED : m_NewEntry_Type.SetCurSel(4); break;
default: ;
}
m_NewEntryValue = (TheType.Value() == NULL?" ":TheType.Value());
m_NewEntrySize = TheType.Size ();
m_NewEntrySlant = TheType.Slant ();
if (TheType.Style()==Aspect_TOF_USERDEFINED)
{
GetDlgItem(IDC_FontMap_EDIT_NewEntrySize)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_EDIT_NewEntrySlant)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry_EditFont)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_FontMap_EDIT_NewEntrySize)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_EDIT_NewEntrySlant)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry_EditFont)->ShowWindow(SW_HIDE);
}
UpdateData(false);
}
void CFontPropertyPage::OnSelchangeFontMapTAB(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateDisplay( m_TabCtrl.GetCurSel()+1);
*pResult = 0;
}
void CFontPropertyPage::OnSelchangeFontMapCOMBONewEntryType()
{
UpdateData(true);
// update the New Entry Value message
if (m_NewEntry_Type.GetCurSel() == Aspect_TOF_USERDEFINED)
{
// allow the user to select a font from the common CFontDialog
GetDlgItem(IDC_FontMap_BUTTON_NewEntry_EditFont)->ShowWindow(SW_SHOW);
m_NewEntryValue = "Please Select a Font";
// remove the posiblility to update while a font was selected
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_EDIT_NewEntrySize)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_EDIT_NewEntrySlant)->ShowWindow(SW_HIDE);
}
else
{
GetDlgItem(IDC_FontMap_EDIT_NewEntrySize)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_EDIT_NewEntrySlant)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry_EditFont)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry)->ShowWindow(SW_SHOW);
Aspect_FontStyle TheType((Aspect_TypeOfFont)m_NewEntry_Type.GetCurSel(),m_NewEntrySize);
m_NewEntryValue = (TheType.Value() == NULL?" ":TheType.Value());
}
UpdateData(false);
}
#include "WNT_FontMapEntry.hxx"
void CFontPropertyPage::OnFontMapBUTTONNewEntryEditFont()
{
Handle(WNT_FontMapEntry) anEntry = new WNT_FontMapEntry((char* const)(LPCTSTR )m_NewEntryValue);
Standard_Address anAddress = anEntry->LogFont();
LOGFONT* lf = (LOGFONT*)(anAddress );
CFontDialog dlg(lf);
if (dlg.DoModal() == IDOK)
{
TCHAR buff[ 255 ];
wsprintf ( buff, "%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%s",
lf->lfHeight, lf->lfWidth, lf->lfEscapement, lf->lfOrientation, lf->lfWeight, lf->lfItalic,
lf->lfUnderline, lf->lfStrikeOut, lf->lfCharSet, lf->lfOutPrecision, lf->lfClipPrecision, lf->lfQuality,
lf->lfPitchAndFamily, lf->lfFaceName);
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry)->ShowWindow(SW_SHOW);
Aspect_FontStyle TheType(buff);
m_NewEntryValue = (TheType.Value() == NULL?" ":TheType.Value());
}
UpdateData(false);
}
void CFontPropertyPage::OnFontMapBUTTONUpdateCurrent()
{
// The Entry to modify :
Aspect_FontMapEntry aFontMapEntry = myFontMap->Entry( m_TabCtrl.GetCurSel()+1);
UpdateData(true);
Aspect_TypeOfFont aTypeOfFont = (Aspect_TypeOfFont)m_NewEntry_Type.GetCurSel();
if (aTypeOfFont == Aspect_TOF_USERDEFINED)
{
Aspect_FontStyle TheType((Standard_CString)(LPCTSTR )m_NewEntryValue);
aFontMapEntry.SetType(TheType);
}
else
{
Aspect_FontStyle TheType((Aspect_TypeOfFont)m_NewEntry_Type.GetCurSel(),m_NewEntrySize,m_NewEntrySlant);
aFontMapEntry.SetType(TheType);
}
myFontMap->AddEntry(aFontMapEntry); // in fact just update
SetModified(true);
UpdateDisplay(m_TabCtrl.GetCurSel()+1);
UpdateData(false);
}
void CFontPropertyPage::OnFontMapBUTTONNewEntry()
{
// The Entry to modify :
Aspect_FontMapEntry aFontMapEntry;
UpdateData(true);
Aspect_TypeOfFont aTypeOfFont = (Aspect_TypeOfFont)m_NewEntry_Type.GetCurSel();
if (aTypeOfFont == Aspect_TOF_USERDEFINED)
{
Aspect_FontStyle TheType((Standard_CString)(LPCTSTR )m_NewEntryValue);
aFontMapEntry.SetType(TheType);
}
else
{
Aspect_FontStyle TheType((Aspect_TypeOfFont)m_NewEntry_Type.GetCurSel(),m_NewEntrySize,m_NewEntrySlant);
aFontMapEntry.SetType(TheType);
}
myFontMap->AddEntry(aFontMapEntry); // in fact just update
SetModified(true);
UpdateDisplay(m_TabCtrl.GetCurSel()+1);
UpdateData(false);
}
BOOL CFontPropertyPage::OnApply()
{
myViewer->SetFontMap(myFontMap);
myViewer->Update();
return CPropertyPage::OnApply();
}

View File

@@ -1,80 +0,0 @@
// FontPropertyPage.h : header file
//
#if !defined(AFX_FontPropertyPage_H__A815F7A5_D51B_11D1_8DDE_0800369C8A03__INCLUDED_)
#define AFX_FontPropertyPage_H__A815F7A5_D51B_11D1_8DDE_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Aspect_FontMap.hxx"
#include <resource.h>
/////////////////////////////////////////////////////////////////////////////
// CFontPropertyPage dialog
class CFontPropertyPage : public CPropertyPage
{
DECLARE_DYNCREATE(CFontPropertyPage)
private :
Handle(Aspect_FontMap) myFontMap;
private :
Handle(V2d_Viewer) myViewer;
public:
void SetViewer(Handle(V2d_Viewer) aViewer) {
myViewer = aViewer;
myFontMap = aViewer->FontMap();
};
// Construction
public:
CFontPropertyPage();
~CFontPropertyPage();
// Dialog Data
//{{AFX_DATA(CFontPropertyPage)
enum { IDD = IDD_DIALOG_Font };
CString m_FontMapSize;
CTabCtrl m_TabCtrl;
CString m_CurrentEntryValue;
CString m_CurrentEntryStyle;
CString m_CurrentEntrySize;
CString m_CurrentEntrySlant;
CComboBox m_NewEntry_Type;
double m_NewEntrySize;
double m_NewEntrySlant;
CString m_NewEntryValue;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CFontPropertyPage)
public:
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CFontPropertyPage)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeFontMapTAB(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnFontMapBUTTONNewEntryEditFont();
afx_msg void OnFontMapBUTTONUpdateCurrent();
afx_msg void OnSelchangeFontMapCOMBONewEntryType();
afx_msg void OnFontMapBUTTONNewEntry();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void UpdateDisplay(int CurrentSelectionIndex);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FontPropertyPage_H__A815F7A5_D51B_11D1_8DDE_0800369C8A03__INCLUDED_)

View File

@@ -1,180 +0,0 @@
// MarkPropertyPage.cpp : implementation file
//
#include "stdafx.h"
#include "MarkPropertyPage.h"
#include "HLRApp.h"
#include "Aspect_MarkMap.hxx"
#include "Aspect_MarkMapEntry.hxx"
#include "TColQuantity_Array1OfLength.hxx"
#include "TColStd_SequenceOfReal.hxx"
#include "TShort_Array1OfShortReal.hxx"
#include "TColStd_Array1OfBoolean.hxx"
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMarkPropertyPage property page
IMPLEMENT_DYNCREATE(CMarkPropertyPage, CPropertyPage)
CMarkPropertyPage::CMarkPropertyPage() : CPropertyPage(CMarkPropertyPage::IDD)
{
//{{AFX_DATA_INIT(CMarkPropertyPage)
m_MarkMapSize = _T("Computing...");
m_CurrentEntryStyle = _T("Computing...");
m_CurrentEntryXValue = _T("Computing...");
m_CurrentEntryYValue = _T("Computing...");
m_CurrentEntrySValue = _T("Computing...");
//}}AFX_DATA_INIT
}
BOOL CMarkPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
UpdateDisplay(1);
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
CMarkPropertyPage::~CMarkPropertyPage()
{
}
void CMarkPropertyPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMarkPropertyPage)
DDX_Control(pDX, IDC_MarkMap_TAB, m_TabCtrl);
DDX_Text(pDX, IDC_MarkMap_STATIC_Size, m_MarkMapSize);
DDX_Text(pDX, IDC_MarkMap_STATIC_CurrentEntryStyle, m_CurrentEntryStyle);
DDX_Text(pDX, IDC_MarkMap_STATIC_CurrentEntryXValue, m_CurrentEntryXValue);
DDX_Text(pDX, IDC_MarkMap_STATIC_CurrentEntryYValue, m_CurrentEntryYValue);
DDX_Text(pDX, IDC_MarkMap_STATIC_CurrentEntrySValue, m_CurrentEntrySValue);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMarkPropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CMarkPropertyPage)
ON_NOTIFY(TCN_SELCHANGE, IDC_MarkMap_TAB, OnSelchangeMarkMapTAB)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMarkPropertyPage message handlers
void CMarkPropertyPage::UpdateDisplay(int CurrentSelectionIndex)
{
TCollection_AsciiString SizeMessage(myMarkMap->Size());
m_MarkMapSize = _T(SizeMessage.ToCString());
m_TabCtrl.DeleteAllItems();
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
for(int i =1;i<=myMarkMap->Size();i++)
{
Aspect_MarkMapEntry aMarkMapEntry = myMarkMap->Entry(i);
TCollection_AsciiString EntryNumerMessage(aMarkMapEntry.Index());
TabCtrlItem.pszText = (LPSTR) EntryNumerMessage.ToCString();
m_TabCtrl.InsertItem( aMarkMapEntry.Index(), &TabCtrlItem );
}
m_TabCtrl.SetCurSel(CurrentSelectionIndex-1);
// update The Current Selected entry
Aspect_MarkMapEntry aMarkMapEntry = myMarkMap->Entry(CurrentSelectionIndex);
if (aMarkMapEntry. IsAllocated () )
{
Aspect_MarkerStyle aMarkerStyle = aMarkMapEntry.Style() ;
switch (aMarkerStyle.Type()) {
case Aspect_TOM_POINT : m_CurrentEntryStyle = _T("Aspect_TOM_POINT"); break;
case Aspect_TOM_PLUS : m_CurrentEntryStyle = _T("Aspect_TOM_PLUS"); break;
case Aspect_TOM_STAR : m_CurrentEntryStyle = _T("Aspect_TOM_STAR"); break;
case Aspect_TOM_O : m_CurrentEntryStyle = _T("Aspect_TOM_O"); break;
case Aspect_TOM_X : m_CurrentEntryStyle = _T("Aspect_TOM_X"); break;
case Aspect_TOM_O_POINT : m_CurrentEntryStyle = _T("Aspect_TOM_O_POINT"); break;
case Aspect_TOM_O_PLUS : m_CurrentEntryStyle = _T("Aspect_TOM_O_PLUS"); break;
case Aspect_TOM_O_STAR : m_CurrentEntryStyle = _T("Aspect_TOM_O_STAR"); break;
case Aspect_TOM_O_X : m_CurrentEntryStyle = _T("Aspect_TOM_O_X"); break;
case Aspect_TOM_BALL : m_CurrentEntryStyle = _T("Aspect_TOM_BALL"); break;
case Aspect_TOM_RING1 : m_CurrentEntryStyle = _T("Aspect_TOM_RING1"); break;
case Aspect_TOM_RING2 : m_CurrentEntryStyle = _T("Aspect_TOM_RING2"); break;
case Aspect_TOM_RING3 : m_CurrentEntryStyle = _T("Aspect_TOM_RING3"); break;
case Aspect_TOM_USERDEFINED : m_CurrentEntryStyle = _T("Aspect_TOM_USERDEFINED"); break;
default : m_CurrentEntryStyle = _T("Underknown");
}
cout<<" aMarkerStyle Length: "<<aMarkerStyle.Length()<<endl;
const TShort_Array1OfShortReal& aMarkerStyleXValues = aMarkerStyle.XValues() ;
const TShort_Array1OfShortReal& aMarkerStyleYValues= aMarkerStyle.YValues() ;
const TColStd_Array1OfBoolean& aMarkerStyleSValues= aMarkerStyle.SValues() ;
TCollection_AsciiString MessageX =BuildValuesAscii(aMarkerStyleXValues);
TCollection_AsciiString MessageY =BuildValuesAscii(aMarkerStyleYValues);
TCollection_AsciiString MessageS =BuildValuesAscii(aMarkerStyleSValues);
m_CurrentEntryXValue = _T(MessageX.ToCString());
m_CurrentEntryYValue = _T(MessageY.ToCString());
m_CurrentEntrySValue = _T(MessageS.ToCString());
}
else
{
m_CurrentEntryStyle = _T("Not Allocated");
m_CurrentEntryXValue = _T("");
m_CurrentEntryYValue = _T("");
m_CurrentEntrySValue = _T("");
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_HIDE);
}
}
void CMarkPropertyPage::OnSelchangeMarkMapTAB(NMHDR* pNMHDR, LRESULT* pResult)
{
UpdateDisplay(m_TabCtrl.GetCurSel()+1);
UpdateData(false);
*pResult = 0;
}
BOOL CMarkPropertyPage::OnApply()
{
// myViewer->SetMarkMap(myMarkMap);
// myViewer->Update();
return CPropertyPage::OnApply();
}
TCollection_AsciiString CMarkPropertyPage::BuildValuesAscii(const TShort_Array1OfShortReal& anArray)
{
TCollection_AsciiString Message;
for(int i=1;i<=anArray.Length();i++)
{
Message += anArray.Value(i);
Message += "\t";
}
return Message;
}
TCollection_AsciiString CMarkPropertyPage::BuildValuesAscii(const TColStd_Array1OfBoolean& anArray)
{
TCollection_AsciiString Message;
for(int i=1;i<=anArray.Length();i++)
{
if (anArray(i)) Message += "True"; else Message += "False";
Message += "\t";
}
return Message;
}

View File

@@ -1,82 +0,0 @@
// MarkPropertyPage.h : header file
//
#if !defined(AFX_MarkPropertyPage_H__B6E7AAD3_DB72_11D1_8DE5_0800369C8A03__INCLUDED_)
#define AFX_MarkPropertyPage_H__B6E7AAD3_DB72_11D1_8DE5_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <resource.h>
#include "V2d_Viewer.hxx"
#include "TColQuantity_Array1OfLength.hxx"
#include "TColQuantity_HArray1OfLength.hxx"
#include "TColStd_Array1OfBoolean.hxx"
/////////////////////////////////////////////////////////////////////////////
// CMarkPropertyPage dialog
class CMarkPropertyPage : public CPropertyPage
{
private :
Handle(Aspect_MarkMap) myMarkMap;
private :
Handle(V2d_Viewer) myViewer;
public:
void SetViewer(Handle(V2d_Viewer) aViewer) {
myViewer = aViewer;
myMarkMap = aViewer->MarkMap();
};
DECLARE_DYNCREATE(CMarkPropertyPage)
// Construction
public:
CMarkPropertyPage();
~CMarkPropertyPage();
// Dialog Data
//{{AFX_DATA(CMarkPropertyPage)
enum { IDD = IDD_DIALOG_Mark };
CTabCtrl m_TabCtrl;
CComboBox m_NewEntryControl;
CString m_MarkMapSize;
CString m_CurrentEntryStyle;
CString m_CurrentEntryXValue;
CString m_CurrentEntryYValue;
CString m_CurrentEntrySValue;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CMarkPropertyPage)
public:
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CMarkPropertyPage)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeMarkMapTAB(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void UpdateDisplay(int CurrentSelectionIndex);
TCollection_AsciiString BuildValuesAscii(const TShort_Array1OfShortReal& anArray);
TCollection_AsciiString BuildValuesAscii(const TColStd_Array1OfBoolean& anArray);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MarkPropertyPage_H__B6E7AAD3_DB72_11D1_8DE5_0800369C8A03__INCLUDED_)

View File

@@ -1,236 +0,0 @@
//
// resources Microsoft Visual C++
//
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
IDD_DIALOG_Color DIALOG DISCARDABLE 0, 0, 281, 186
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Color Map "
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Type Of The Color Map :",IDC_STATIC,20,10,87,10
LTEXT "To be updated ...",IDC_ColorMap_STATIC_Type,110,10,69,
10
LTEXT "Size Of The Color Map :",IDC_STATIC,20,20,79,10
CONTROL "Tab1",IDC_ColorMap_TAB,"SysTabControl32",TCS_BUTTONS,19,
53,242,15
LTEXT "To be updated ...",IDC_ColorMap_STATIC_Size,110,20,69,
10
GROUPBOX "Entries :",IDC_STATIC,10,40,264,50
LTEXT "Color Name :",IDC_STATIC,20,75,50,10
LTEXT "To be updated ...",IDC_ColorMap_STATIC_EntryColorName,
204,75,69,10
PUSHBUTTON "Add",IDC_ColorMap_BUTTON_AddNewEntry,110,145,55,15
GROUPBOX "New Entry",IDC_STATIC,10,100,267,79
PUSHBUTTON "Update Current",IDC_ColorMap_BUTTON_UpdateCurrentEntry,
20,145,55,15
LTEXT "Color Name :",
IDC_ColorMap_STATIC_NewEntryColorNameStatic,20,120,55,10
PUSHBUTTON "Edit...",IDC_ColorMap_BUTTON_NewEntry_EditColor,204,145,
55,15
LTEXT "999",IDC_ColorMap_STATIC_EntryColorRed,75,75,35,10
LTEXT "999",IDC_ColorMap_STATIC_EntryColorGreen,120,75,35,10
LTEXT "999",IDC_ColorMap_STATIC_EntryColorBlue,165,75,35,10
EDITTEXT IDC_ColorMap_EDIT_NewEntryColorRed,75,120,35,12,
ES_AUTOHSCROLL
EDITTEXT IDC_ColorMap_EDIT_NewEntryColorGreen,120,120,30,12,
ES_AUTOHSCROLL
EDITTEXT IDC_ColorMap_EDIT_NewEntryColorBlue,165,120,35,12,
ES_AUTOHSCROLL
COMBOBOX IDC_ColorMap_COMBO_NewEntryColorName,204,120,70,193,
CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "New Generic Color Map",
IDC_ColorMap_BUTTON_NewGenericColorMap,179,4,95,13
LTEXT "Not available for this type of Color map",
IDC_ColorMap_STATIC_NewEntryNotavailable,70,130,160,10
PUSHBUTTON "New Color Cube Color Map ",
IDC_ColorMap_BUTTON_NewColorCubeColorMap,179,18,95,13
PUSHBUTTON "New Color Ramp Color Map",
IDC_ColorMap_BUTTON_NewColorRampColorMap,179,31,95,13
END
IDD_DIALOG_Font DIALOGEX 0, 0, 287, 210
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Font Map"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Size Of The Font Map :",IDC_STATIC,20,10,80,10
LTEXT "To be updated ...",IDC_FontMap_STATIC_Size,110,10,80,10
GROUPBOX "Entries :",IDC_STATIC,10,28,270,97,0,WS_EX_TRANSPARENT
CONTROL "Tab1",IDC_FontMap_TAB,"SysTabControl32",TCS_BUTTONS,20,
40,242,15
GROUPBOX "New Entry",IDC_STATIC,10,130,270,73
PUSHBUTTON "Update Current",IDC_FontMap_BUTTON_UpdateCurrent,158,
181,55,15
PUSHBUTTON "Add",IDC_FontMap_BUTTON_NewEntry,221,179,55,16
LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntryValue,
63,75,217,10
LTEXT "Type :",IDC_STATIC,21,155,23,10
LTEXT "Type :",IDC_STATIC,21,60,40,10
LTEXT "To be updated ...",IDC_FontMap_STATIC_CurrentEntryType,
63,60,80,10
LTEXT "Size :",IDC_STATIC,21,174,42,10
LTEXT "Slant :",IDC_STATIC,21,189,28,10
EDITTEXT IDC_FontMap_EDIT_NewEntrySize,63,172,62,12,
ES_AUTOHSCROLL | ES_WANTRETURN
EDITTEXT IDC_FontMap_EDIT_NewEntrySlant,63,187,62,12,
ES_AUTOHSCROLL | ES_WANTRETURN
LTEXT "Size :",IDC_STATIC,21,90,30,10
LTEXT "Slant :",IDC_STATIC,21,106,36,10
LTEXT "Value :",IDC_STATIC,21,75,40,10
LTEXT "Type :",IDC_STATIC,21,140,42,10
COMBOBOX IDC_FontMap_COMBO_NewEntryType,63,138,113,77,
CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_FontMap_EDIT_NewEntryValue,63,153,209,12,
ES_AUTOHSCROLL | ES_READONLY
LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntrySize,
63,90,70,10
LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntrySlant,
63,106,80,10
PUSHBUTTON "Edit...",IDC_FontMap_BUTTON_NewEntry_EditFont,191,138,
55,12
END
IDD_DIALOG_Width DIALOG DISCARDABLE 0, 0, 281, 167
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Width Map "
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Size Of The Width Map :",IDC_STATIC,15,10,80,10
CONTROL "Tab1",IDC_WidthMap_TAB,"SysTabControl32",TCS_BUTTONS,21,
40,242,15
LTEXT "To be updated ...",IDC_WidthMap_STATIC_Size,107,10,80,
10
GROUPBOX "Entries :",IDC_STATIC,10,30,264,57
LTEXT "Type :",IDC_STATIC,15,60,80,10
LTEXT "Width :",IDC_STATIC,15,75,80,10
LTEXT "Type :",IDC_STATIC,15,115,49,10
LTEXT "Width :",IDC_STATIC,15,130,49,10
COMBOBOX IDC_WidthMap_COMBO_NewEntryType,70,113,113,77,
CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_WidthMap_EDIT_NewEntryWidth,70,128,62,12,
ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN
LTEXT "To be updated ...",IDC_WidthMap_STATIC_EntryType,107,60,
80,10
LTEXT "To be updated ...",IDC_WidthMap_STATIC_EntryWidth,107,
75,80,10
PUSHBUTTON "Add",IDC_WidthMap_BUTTON_AddNewEntry,200,130,55,15
GROUPBOX "New Entry",IDC_STATIC,7,101,267,51
PUSHBUTTON "Update Current",IDC_WidthMap_BUTTON_UpdateCurrentEntry,
200,110,55,15
END
IDD_DIALOG_NewColorCube DIALOG DISCARDABLE 0, 0, 207, 156
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "New Color Cube"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,150,10,50,13
PUSHBUTTON "Cancel",IDCANCEL,150,30,50,14
LTEXT "base_pixel",IDC_STATIC,20,10,50,10
LTEXT "greenmax",IDC_STATIC,20,70,50,10
LTEXT "greenmult",IDC_STATIC,20,90,50,10
LTEXT "bluemax",IDC_STATIC,20,110,50,10
LTEXT "bluemult",IDC_STATIC,20,130,50,10
EDITTEXT IDC_NewColorCube_EDIT_bluemult,80,130,50,12,
ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_NewColorCube_EDIT_bluemax,80,110,50,12,
ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_NewColorCube_EDIT_grennmult,80,90,50,12,
ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_NewColorCube_EDIT_greenmax,80,70,50,12,
ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_NewColorCube_EDIT_base_pixel,80,10,50,12,
ES_AUTOHSCROLL | ES_NUMBER
LTEXT "redmax",IDC_STATIC,20,30,50,10
EDITTEXT IDC_NewColorCube_EDIT_redmax,80,30,50,12,ES_AUTOHSCROLL |
ES_NUMBER
LTEXT "redmult",IDC_STATIC,20,50,50,10
EDITTEXT IDC_NewColorCube_EDIT_redmult,80,50,50,12,ES_AUTOHSCROLL |
ES_NUMBER
END
IDD_DIALOG_NewColorRamp DIALOG DISCARDABLE 0, 0, 252, 121
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "New Color ramp"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,150,10,50,13
PUSHBUTTON "Cancel",IDCANCEL,150,30,50,14
LTEXT "base_pixel",-1,20,10,49,10
EDITTEXT IDC_NewColorRamp_EDIT_base_pixel,80,10,40,12,
ES_AUTOHSCROLL | ES_NUMBER
LTEXT "dimension",-1,20,30,49,10
EDITTEXT IDC_NewColorramp_EDIT_dimension,80,30,40,12,
ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Color Name :",
IDC_ColorMap_STATIC_NewEntryColorNameStatic,20,50,49,10
PUSHBUTTON "Edit...",IDC_NewColorMapRamp_BUTTON_EditColor,145,70,55,10
EDITTEXT IDC_NewColorMapRamp_EDIT_ColorRed,28,70,35,12,
ES_AUTOHSCROLL
EDITTEXT IDC_NewColorMapRamp_EDIT_ColorGreen,65,70,35,12,
ES_AUTOHSCROLL
EDITTEXT IDC_NewColorMapRamp_EDIT_ColorBlue,103,70,35,12,
ES_AUTOHSCROLL
COMBOBOX IDC_NewColorMap_COMBO_NewEntryColorName,80,50,70,193,
CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
END
IDD_DIALOG_Type DIALOGEX 0, 0, 287, 170
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Type Map"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Size Of The Typet Map :",-1,20,10,80,10
LTEXT "To be updated ...",IDC_TypeMap_STATIC_Size,110,10,80,10
GROUPBOX "Entries :",-1,10,28,270,62,0,WS_EX_TRANSPARENT
CONTROL "Tab1",IDC_TypeMap_TAB,"SysTabControl32",TCS_BUTTONS,20,
40,242,15
GROUPBOX "New Entry",-1,10,100,270,60
PUSHBUTTON "Update Current",IDC_FontMap_BUTTON_UpdateCurrent,160,
140,55,15
PUSHBUTTON "Add",IDC_FontMap_BUTTON_NewEntry,220,140,55,15
LTEXT "To be updated...",IDC_TypeMap_STATIC_CurrentEntryValue,
63,75,217,10
LTEXT "Value :",-1,21,126,42,10
LTEXT "Style :",-1,21,60,40,10
LTEXT "To be updated ...",IDC_TypeMap_STATIC_CurrentEntryStyle,
63,60,80,10
LTEXT "Value :",-1,21,75,40,10
LTEXT "Style :",-1,21,111,42,10
COMBOBOX IDC_TypeMap_COMBO_NewEntryStyle,63,108,113,77,
CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_TypeMap_EDIT_NewEntryValue,63,124,194,12,
ES_AUTOHSCROLL | ES_READONLY
END
IDD_DIALOG_Mark DIALOGEX 0, 0, 287, 201
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mark Map"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Size Of The Mark Map :",AFX_ID_PREVIEW_CLOSE,20,10,80,
10
LTEXT "To be updated ...",IDC_MarkMap_STATIC_Size,110,10,80,10
GROUPBOX "Entries :",-1,10,28,270,92,0,WS_EX_TRANSPARENT
CONTROL "Tab1",IDC_MarkMap_TAB,"SysTabControl32",TCS_BUTTONS,20,
40,242,15
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryXValue,
63,75,217,9
LTEXT "Style :",-1,21,60,40,10
LTEXT "To be updated ...",IDC_MarkMap_STATIC_CurrentEntryStyle,
63,60,80,10
LTEXT "XValue :",-1,21,75,40,9
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryYValue,
63,90,217,10
LTEXT "YValue :",-1,21,90,40,10
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntrySValue,
63,105,217,10
LTEXT "SValue :",-1,21,105,40,10
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryValue,
62,90,217,10
END

View File

@@ -1,63 +0,0 @@
// MapProperties.cpp : implementation file
//
#include "stdafx.h"
#include "PropertiesSheet.h"
#include "HLRApp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPropertiesSheet
IMPLEMENT_DYNAMIC(CPropertiesSheet, CPropertySheet)
CPropertiesSheet::CPropertiesSheet(CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet("View Map Properties", pParentWnd, iSelectPage)
{
}
void CPropertiesSheet::SetViewer (Handle(V2d_Viewer) aViewer)
{
AddPage(& m_pageWidthProperty);
m_pageWidthProperty.SetViewer(aViewer);
AddPage(& m_pageColorProperty);
m_pageColorProperty.SetViewer(aViewer);
AddPage(& m_pageFontProperty);
m_pageFontProperty.SetViewer(aViewer);
AddPage(& m_pageTypeProperty);
m_pageTypeProperty.SetViewer(aViewer);
AddPage(& m_pageMarkProperty);
m_pageMarkProperty.SetViewer(aViewer);
}
CPropertiesSheet::~CPropertiesSheet()
{
}
BEGIN_MESSAGE_MAP(CPropertiesSheet, CPropertySheet)
//{{AFX_MSG_MAP(CPropertiesSheet)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPropertiesSheet message handlers
BOOL CPropertiesSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
return bResult;
}

View File

@@ -1,68 +0,0 @@
#if !defined(AFX_PropertiesSheet_H__A815F7A6_D51B_11D1_8DDE_0800369C8A03__INCLUDED_)
#define AFX_PropertiesSheet_H__A815F7A6_D51B_11D1_8DDE_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// PropertiesSheet.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CPropertiesSheet
#include "ColorPropertyPage.h"
#include "FontPropertyPage.h"
#include "WidthPropertyPage.h"
#include "TypePropertyPage.h"
#include "MarkPropertyPage.h"
class CPropertiesSheet : public CPropertySheet
{
DECLARE_DYNAMIC(CPropertiesSheet)
private :
CColorPropertyPage m_pageColorProperty;
CFontPropertyPage m_pageFontProperty;
CWidthPropertyPage m_pageWidthProperty;
CTypePropertyPage m_pageTypeProperty;
CMarkPropertyPage m_pageMarkProperty;
// Construction
public:
CPropertiesSheet(CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
void SetViewer (Handle(V2d_Viewer) aViewer);
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPropertiesSheet)
public:
virtual BOOL OnInitDialog();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CPropertiesSheet();
// Generated message map functions
protected:
//{{AFX_MSG(CPropertiesSheet)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PropertiesSheet_H__A815F7A6_D51B_11D1_8DDE_0800369C8A03__INCLUDED_)

View File

@@ -1,294 +0,0 @@
// TypePropertyPage.cpp : implementation file
//
#include "stdafx.h"
#include "TypePropertyPage.h"
#include "HLRApp.h"
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "Aspect_TypeMap.hxx"
#include "Aspect_TypeMapEntry.hxx"
#include "TColQuantity_Array1OfLength.hxx"
#include "TColStd_SequenceOfReal.hxx"
/////////////////////////////////////////////////////////////////////////////
// CTypePropertyPage property page
IMPLEMENT_DYNCREATE(CTypePropertyPage, CPropertyPage)
CTypePropertyPage::CTypePropertyPage() : CPropertyPage(CTypePropertyPage::IDD)
{
//{{AFX_DATA_INIT(CTypePropertyPage)
m_TypeMapSize = _T("Computing...");
m_CurrentEntryStyle = _T("Computing...");
m_CurrentEntryValue = _T("Computing...");
m_NewEntryValue = _T("");
//}}AFX_DATA_INIT
}
BOOL CTypePropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
m_NewEntryControl.AddString("SOLID");
m_NewEntryControl.AddString("DASH");
m_NewEntryControl.AddString("DOT");
m_NewEntryControl.AddString("DOTDASH");
m_NewEntryControl.AddString("USERDEFINED");
m_NewEntryControl.SetCurSel(1);
UpdateDisplay(1);
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
CTypePropertyPage::~CTypePropertyPage()
{
}
void CTypePropertyPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTypePropertyPage)
DDX_Control(pDX, IDC_TypeMap_TAB, m_TabCtrl);
DDX_Control(pDX, IDC_TypeMap_COMBO_NewEntryStyle, m_NewEntryControl);
DDX_Control(pDX, IDC_TypeMap_EDIT_NewEntryValue, m_NewEntryValueControl);
DDX_Text(pDX, IDC_TypeMap_STATIC_Size, m_TypeMapSize);
DDX_Text(pDX, IDC_TypeMap_STATIC_CurrentEntryStyle, m_CurrentEntryStyle);
DDX_Text(pDX, IDC_TypeMap_STATIC_CurrentEntryValue, m_CurrentEntryValue);
DDX_Text(pDX, IDC_TypeMap_EDIT_NewEntryValue, m_NewEntryValue);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTypePropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CTypePropertyPage)
ON_BN_CLICKED(IDC_FontMap_BUTTON_NewEntry, OnFontMapBUTTONNewEntry)
ON_BN_CLICKED(IDC_FontMap_BUTTON_UpdateCurrent, OnFontMapBUTTONUpdateCurrent)
ON_EN_CHANGE(IDC_TypeMap_EDIT_NewEntryValue, OnChangeTypeMapEDITNewEntryValue)
ON_NOTIFY(TCN_SELCHANGE, IDC_TypeMap_TAB, OnSelchangeTypeMapTAB)
ON_CBN_SELCHANGE(IDC_TypeMap_COMBO_NewEntryStyle, OnSelchangeTypeMapCOMBONewEntryStyle)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTypePropertyPage message handlers
void CTypePropertyPage::UpdateDisplay(int CurrentSelectionIndex)
{
TCollection_AsciiString SizeMessage(myTypeMap->Size());
m_TypeMapSize = _T(SizeMessage.ToCString());
m_TabCtrl.DeleteAllItems();
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
for(int i =1;i<=myTypeMap->Size();i++)
{
Aspect_TypeMapEntry aTypeMapEntry = myTypeMap->Entry(i);
TCollection_AsciiString EntryNumerMessage(aTypeMapEntry.Index());
TabCtrlItem.pszText = (LPSTR) EntryNumerMessage.ToCString();
m_TabCtrl.InsertItem( aTypeMapEntry.Index(), &TabCtrlItem );
}
m_TabCtrl.SetCurSel(CurrentSelectionIndex-1);
// update The Current Selected entry
Aspect_TypeMapEntry aTypeMapEntry = myTypeMap->Entry(CurrentSelectionIndex);
if (aTypeMapEntry. IsAllocated () )
{
Aspect_LineStyle TypeMapEntryType = aTypeMapEntry.Type() ;
switch (TypeMapEntryType.Style()) {
case Aspect_TOL_SOLID : m_CurrentEntryStyle = _T("SOLID"); break;
case Aspect_TOL_DASH : m_CurrentEntryStyle = _T("DASH"); break;
case Aspect_TOL_DOT : m_CurrentEntryStyle = _T("DOT"); break;
case Aspect_TOL_DOTDASH : m_CurrentEntryStyle = _T("DOTDASH"); break;
case Aspect_TOL_USERDEFINED : m_CurrentEntryStyle = _T("USERDEFINED"); break;
default : m_CurrentEntryStyle = _T("Underknown");
}
int NbValue = TypeMapEntryType.Length();
TCollection_AsciiString Message = BuildValuesAscii(TypeMapEntryType.Values());
m_CurrentEntryValue = _T(Message.ToCString());
m_NewEntryControl.SetCurSel(TypeMapEntryType.Style());
m_NewEntryValue = _T(Message.ToCString());
if (TypeMapEntryType.Style() == Aspect_TOL_USERDEFINED)
m_NewEntryValueControl.SetReadOnly( false );
else
m_NewEntryValueControl.SetReadOnly( true );
}
else
{
m_CurrentEntryStyle = _T("Not Allocated");
m_CurrentEntryValue = _T("");
m_NewEntryValue = _T("No value");
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_HIDE);
}
}
void CTypePropertyPage::OnSelchangeTypeMapTAB(NMHDR* pNMHDR, LRESULT* pResult)
{
UpdateDisplay(m_TabCtrl.GetCurSel()+1);
UpdateData(false);
*pResult = 0;
}
void CTypePropertyPage::OnSelchangeTypeMapCOMBONewEntryStyle()
{
UpdateData(true);
// the Type Map entry change in the edit part
if (m_NewEntryControl.GetCurSel() == Aspect_TOL_USERDEFINED)
m_NewEntryValueControl.SetReadOnly( false );
else
{
m_NewEntryValueControl.SetReadOnly( true );
// create a dummy map to extract the default values
Aspect_TypeMapEntry aTypeMapEntry(99,(Aspect_TypeOfLine)m_NewEntryControl.GetCurSel());
Aspect_LineStyle TypeMapEntryType = aTypeMapEntry.Type() ;
TCollection_AsciiString Message = BuildValuesAscii(TypeMapEntryType.Values());
m_NewEntryValue = _T(Message.ToCString());
}
UpdateData(false);
}
void CTypePropertyPage::OnChangeTypeMapEDITNewEntryValue()
{
UpdateData(true);
Handle(TColQuantity_HArray1OfLength) anArray;
Standard_Boolean IsDone = ExtractValues(TCollection_AsciiString((char *)(LPCSTR)m_NewEntryValue),anArray);
if (IsDone)
{
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_FontMap_BUTTON_UpdateCurrent)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_FontMap_BUTTON_NewEntry)->ShowWindow(SW_HIDE);
}
}
void CTypePropertyPage::OnFontMapBUTTONNewEntry()
{
UpdateData(true);
int NewEntry;
if (m_NewEntryControl.GetCurSel() == Aspect_TOL_USERDEFINED)
{
Handle(TColQuantity_HArray1OfLength) anArray;
if (ExtractValues(TCollection_AsciiString((char *)(LPCSTR)m_NewEntryValue),anArray))
{
Aspect_LineStyle aLineStyle(anArray->Array1());
NewEntry = myTypeMap->AddEntry( aLineStyle );
}
else Standard_Failure::Raise(" The String is not Valid ");
}
else
{
Aspect_LineStyle aLineStyle((Aspect_TypeOfLine)m_NewEntryControl.GetCurSel());
NewEntry = myTypeMap->AddEntry( aLineStyle );
}
SetModified(true);
UpdateDisplay(NewEntry);
UpdateData(false);
}
void CTypePropertyPage::OnFontMapBUTTONUpdateCurrent()
{
UpdateData(true);
Aspect_TypeMapEntry aTypeMapEntry = myTypeMap->Entry( m_TabCtrl.GetCurSel()+1);
if (m_NewEntryControl.GetCurSel() == Aspect_TOL_USERDEFINED)
{
Handle(TColQuantity_HArray1OfLength) anArray;
if (ExtractValues(TCollection_AsciiString((char *)(LPCSTR)m_NewEntryValue),anArray))
{
Aspect_LineStyle aLineStyle(anArray->Array1());
aTypeMapEntry.SetType( aLineStyle );
}
else Standard_Failure::Raise(" The String is not Valid ");
}
else
{
Aspect_LineStyle aLineStyle((Aspect_TypeOfLine)m_NewEntryControl.GetCurSel());
aTypeMapEntry.SetType( aLineStyle );
}
myTypeMap->AddEntry(aTypeMapEntry); // in fact just update
SetModified(true);
UpdateDisplay(m_TabCtrl.GetCurSel()+1);
UpdateData(false);
}
BOOL CTypePropertyPage::OnApply()
{
myViewer->SetTypeMap(myTypeMap);
myViewer->Update();
return CPropertyPage::OnApply();
}
Standard_Boolean CTypePropertyPage::ExtractValues(TCollection_AsciiString aMessage,
Handle(TColQuantity_HArray1OfLength)& anArray) // out
{
TColStd_SequenceOfReal aSequenceOfReal;
Standard_Integer CurrentStartValue=1;
bool NotFinish = true;
while (NotFinish)
{
CurrentStartValue = aMessage.SearchFromEnd(";");
if ( CurrentStartValue == aMessage.Length()) return Standard_False;
if (CurrentStartValue != -1)
{
TCollection_AsciiString aNewMessage = aMessage.Split(CurrentStartValue);
aMessage.Remove(aMessage.Length());
if (aNewMessage.IsRealValue())
aSequenceOfReal.Append(aNewMessage.RealValue());
else return Standard_False;
}
else
{
if (aMessage.IsRealValue())
aSequenceOfReal.Append(aMessage.RealValue());
else return Standard_False;
NotFinish = false;
}
}
anArray = new TColQuantity_HArray1OfLength(1,aSequenceOfReal.Length());
for (int i=1;i<=aSequenceOfReal.Length();i++)
anArray->SetValue(i,aSequenceOfReal(aSequenceOfReal.Length()-i+1));
return Standard_True;
}
TCollection_AsciiString CTypePropertyPage::BuildValuesAscii(const TColQuantity_Array1OfLength& anArray)
{
TCollection_AsciiString Message;
int NbValue = anArray.Length();
for (int j=1;j<NbValue;j++)
{
Message += anArray(j);
Message += " ; ";
}
Quantity_Length Length = anArray(NbValue);
if (Length > Precision::Confusion()) Message += Length;
else Message += "No value";
return Message;
}

View File

@@ -1,84 +0,0 @@
// TypePropertyPage.h : header file
//
#if !defined(AFX_TypePropertyPage_H__B6E7AAD3_DB72_11D1_8DE5_0800369C8A03__INCLUDED_)
#define AFX_TypePropertyPage_H__B6E7AAD3_DB72_11D1_8DE5_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <resource.h>
#include "V2d_Viewer.hxx"
#include "TColQuantity_HArray1OfLength.hxx"
/////////////////////////////////////////////////////////////////////////////
// CTypePropertyPage dialog
class CTypePropertyPage : public CPropertyPage
{
private :
Handle(Aspect_TypeMap) myTypeMap;
private :
Handle(V2d_Viewer) myViewer;
public:
void SetViewer(Handle(V2d_Viewer) aViewer) {
myViewer = aViewer;
myTypeMap = aViewer->TypeMap();
};
DECLARE_DYNCREATE(CTypePropertyPage)
// Construction
public:
CTypePropertyPage();
~CTypePropertyPage();
// Dialog Data
//{{AFX_DATA(CTypePropertyPage)
enum { IDD = IDD_DIALOG_Type };
CTabCtrl m_TabCtrl;
CComboBox m_NewEntryControl;
CString m_TypeMapSize;
CString m_CurrentEntryStyle;
CString m_CurrentEntryValue;
CEdit m_NewEntryValueControl;
CString m_NewEntryValue;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CTypePropertyPage)
public:
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTypePropertyPage)
virtual BOOL OnInitDialog();
afx_msg void OnFontMapBUTTONNewEntry();
afx_msg void OnFontMapBUTTONUpdateCurrent();
afx_msg void OnChangeTypeMapEDITNewEntryValue();
afx_msg void OnSelchangeTypeMapTAB(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangeTypeMapCOMBONewEntryStyle();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void UpdateDisplay(int CurrentSelectionIndex);
TCollection_AsciiString BuildValuesAscii(const TColQuantity_Array1OfLength& anArray);
Standard_Boolean ExtractValues(TCollection_AsciiString aMessage,Handle(TColQuantity_HArray1OfLength)& anArray);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TypePropertyPage_H__B6E7AAD3_DB72_11D1_8DE5_0800369C8A03__INCLUDED_)

View File

@@ -1,191 +0,0 @@
// WidthPropertyPage.cpp : implementation file
//
#include "stdafx.h"
#include "WidthPropertyPage.h"
#include "HLRApp.h"
#include "Aspect_WidthMapEntry.hxx"
#include "Aspect_LineStyle.hxx"
#ifdef _DEBUG
// #define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWidthPropertyPage property page
IMPLEMENT_DYNCREATE(CWidthPropertyPage, CPropertyPage)
CWidthPropertyPage::CWidthPropertyPage() : CPropertyPage(CWidthPropertyPage::IDD)
{
//{{AFX_DATA_INIT(CWidthPropertyPage)
m_WidthMapSize = _T("Computing...");
m_EntryType = _T("Computing...");
m_EntryWidth = _T("Computing...");
m_NewEntryWidth = 1;
//}}AFX_DATA_INIT
}
CWidthPropertyPage::~CWidthPropertyPage()
{
}
void CWidthPropertyPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWidthPropertyPage)
DDX_Text (pDX, IDC_WidthMap_STATIC_Size, m_WidthMapSize);
DDX_Control (pDX, IDC_WidthMap_TAB, m_TabCtrl);
DDX_Text (pDX, IDC_WidthMap_STATIC_EntryType, m_EntryType);
DDX_Text (pDX, IDC_WidthMap_STATIC_EntryWidth, m_EntryWidth);
DDX_Control (pDX, IDC_WidthMap_COMBO_NewEntryType, m_NewEntryType);
DDX_Control (pDX, IDC_WidthMap_EDIT_NewEntryWidth, m_NewEntryWidthControl);
DDX_Text (pDX, IDC_WidthMap_EDIT_NewEntryWidth, m_NewEntryWidth);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWidthPropertyPage, CPropertyPage)
//{{AFX_MSG_MAP(CWidthPropertyPage)
ON_NOTIFY(TCN_SELCHANGE, IDC_WidthMap_TAB, OnSelchangeDialogWidthTAB)
ON_BN_CLICKED(IDC_WidthMap_BUTTON_AddNewEntry, OnWidthMapBUTTONAddNewEntry)
ON_CBN_SELCHANGE(IDC_WidthMap_COMBO_NewEntryType, OnSelchangeWidthMapCOMBONewEntryType)
ON_BN_CLICKED(IDC_WidthMap_BUTTON_UpdateCurrentEntry, OnWidthMapBUTTONUpdateCurrentEntry)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWidthPropertyPage message handlers
BOOL CWidthPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// update the CComboBox to add the enumeration possibilities.
m_NewEntryType.AddString( "THIN" );
m_NewEntryType.AddString( "MEDIUM" );
m_NewEntryType.AddString( "THICK" );
m_NewEntryType.AddString( "VERYTHICK" );
m_NewEntryType.AddString( "USERDEFINED" );
m_NewEntryType.SetCurSel(0);
UpdateDisplay(1);
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CWidthPropertyPage::UpdateDisplay(int CurrentSelectionIndex)
{
// Update the size of the Width map
TCollection_AsciiString SizeMessage(myWidthMap->Size());
m_WidthMapSize = _T(SizeMessage.ToCString());
// clear the Tab Ctrl
m_TabCtrl.DeleteAllItems();
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
for(int i =1;i<=myWidthMap->Size();i++)
{
Aspect_WidthMapEntry aWidthMapEntry = myWidthMap->Entry(i);
TCollection_AsciiString EntryNumerMessage(aWidthMapEntry.Index());
TabCtrlItem.pszText = (LPSTR) EntryNumerMessage.ToCString();
m_TabCtrl.InsertItem( aWidthMapEntry.Index(), &TabCtrlItem );
}
m_TabCtrl.SetCurSel(CurrentSelectionIndex-1);
// update the current Entry informations
Aspect_WidthMapEntry aWidthMapEntry = myWidthMap->Entry(CurrentSelectionIndex);
// update the current entry
switch (aWidthMapEntry.Type()) {
case Aspect_WOL_THIN : m_EntryType = _T("Aspect_WOL_THIN") ; break;
case Aspect_WOL_MEDIUM : m_EntryType = _T("Aspect_WOL_MEDIUM") ; break;
case Aspect_WOL_THICK : m_EntryType = _T("Aspect_WOL_THICK") ; break;
case Aspect_WOL_VERYTHICK : m_EntryType = _T("Aspect_WOL_VERYTHICK") ; break;
case Aspect_WOL_USERDEFINED : m_EntryType = _T("Aspect_WOL_USERDEFINED") ; break;
default : cout<<" Underknown";
}
TCollection_AsciiString WidthMessage(aWidthMapEntry.Width());
m_EntryWidth = _T(WidthMessage.ToCString());
// update the edit / new part of the
// also update the edit part
m_NewEntryType.SetCurSel(aWidthMapEntry.Type());
m_NewEntryWidth = aWidthMapEntry.Width();
if (aWidthMapEntry.Type() == Aspect_WOL_USERDEFINED)
m_NewEntryWidthControl.SetReadOnly( false);
else
m_NewEntryWidthControl.SetReadOnly( true);
if (CurrentSelectionIndex == 1) // the item 1 is not editable ( in the map by default )
GetDlgItem(IDC_WidthMap_BUTTON_UpdateCurrentEntry)->ShowWindow(SW_HIDE);
else
GetDlgItem(IDC_WidthMap_BUTTON_UpdateCurrentEntry)->ShowWindow(SW_SHOW);
}
void CWidthPropertyPage::OnSelchangeDialogWidthTAB(NMHDR* pNMHDR, LRESULT* pResult)
{
UpdateDisplay( m_TabCtrl.GetCurSel()+1);
UpdateData(false);
*pResult = 0;
}
void CWidthPropertyPage::OnSelchangeWidthMapCOMBONewEntryType()
{
UpdateData(true);
// the Width Map entry change in the edit part
if (m_NewEntryType.GetCurSel() == Aspect_WOL_USERDEFINED)
m_NewEntryWidthControl.SetReadOnly( false);
else
{
m_NewEntryWidthControl.SetReadOnly( true);
Aspect_WidthMapEntry aTmpWidthMapEntry (99,(Aspect_WidthOfLine)m_NewEntryType.GetCurSel());
m_NewEntryWidth = aTmpWidthMapEntry.Width();
}
UpdateData(false);
}
void CWidthPropertyPage::OnWidthMapBUTTONAddNewEntry()
{
UpdateData(true);
int NewEntry;
if (m_NewEntryType.GetCurSel() == Aspect_WOL_USERDEFINED)
NewEntry =myWidthMap->AddEntry(m_NewEntryWidth);
else
NewEntry =myWidthMap->AddEntry( (Aspect_WidthOfLine)m_NewEntryType.GetCurSel());
SetModified(true);
UpdateDisplay(NewEntry);
UpdateData(false);
}
void CWidthPropertyPage::OnWidthMapBUTTONUpdateCurrentEntry()
{
UpdateData(true);
Aspect_WidthMapEntry aWidthMapEntry = myWidthMap->Entry( m_TabCtrl.GetCurSel()+1);
if (m_NewEntryType.GetCurSel() == Aspect_WOL_USERDEFINED)
aWidthMapEntry.SetWidth(m_NewEntryWidth );
else
aWidthMapEntry.SetType((Aspect_WidthOfLine)m_NewEntryType.GetCurSel());
myWidthMap->AddEntry(aWidthMapEntry); // in fact just update
SetModified(true);
UpdateDisplay(m_TabCtrl.GetCurSel()+1);
UpdateData(false);
}
BOOL CWidthPropertyPage::OnApply()
{
//AfxGetMainWnd()->SendMessage(WM_USERAPPLY_InMapProperties);
myViewer->SetWidthMap(myWidthMap);
myViewer->Update();
return CPropertyPage::OnApply();
}

View File

@@ -1,78 +0,0 @@
// WidthProperty.h : header file
//
#if !defined(AFX_WIDTHPROPERTY_H__0F6C04B3_D5DB_11D1_8DDF_0800369C8A03__INCLUDED_)
#define AFX_WIDTHPROPERTY_H__0F6C04B3_D5DB_11D1_8DDF_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <resource.h>
#include "Aspect_WidthMap.hxx"
/////////////////////////////////////////////////////////////////////////////
// CWidthPropertyPage dialog
class CWidthPropertyPage : public CPropertyPage
{
DECLARE_DYNCREATE(CWidthPropertyPage)
private :
Handle(Aspect_WidthMap) myWidthMap;
private :
Handle(V2d_Viewer) myViewer;
public:
void SetViewer(Handle(V2d_Viewer) aViewer) {
myViewer = aViewer;
myWidthMap = aViewer->WidthMap();
};
// Construction
public:
CWidthPropertyPage();
~CWidthPropertyPage();
// Dialog Data
//{{AFX_DATA(CWidthPropertyPage)
enum { IDD = IDD_DIALOG_Width };
CString m_WidthMapSize;
CTabCtrl m_TabCtrl;
CString m_EntryType;
CString m_EntryWidth;
CComboBox m_NewEntryType;
CEdit m_NewEntryWidthControl;
double m_NewEntryWidth;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CWidthPropertyPage)
public:
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CWidthPropertyPage)
afx_msg void OnSelchangeDialogWidthTAB(NMHDR* pNMHDR, LRESULT* pResult);
virtual BOOL OnInitDialog();
afx_msg void OnWidthMapBUTTONAddNewEntry();
afx_msg void OnSelchangeWidthMapCOMBONewEntryType();
afx_msg void OnWidthMapBUTTONUpdateCurrentEntry();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void UpdateDisplay(int CurrentSelectionIndex);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WIDTHPROPERTY_H__0F6C04B3_D5DB_11D1_8DDF_0800369C8A03__INCLUDED_)

View File

@@ -1,64 +0,0 @@
// ColorNewColorRampColorMapDialog.h : header file
//
#if !defined(AFX_ColorNewColorRampColorMapDialog_H__A45F6973_DB41_11D1_8DE5_0800369C8A03__INCLUDED_)
#define AFX_ColorNewColorRampColorMapDialog_H__A45F6973_DB41_11D1_8DE5_0800369C8A03__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <resource.h>
/////////////////////////////////////////////////////////////////////////////
// CColorNewColorRampColorMapDialog dialog
class CColorNewColorRampColorMapDialog : public CDialog
{
private :
Handle(Aspect_ColorMap) myColorMap;
// Construction
public:
CColorNewColorRampColorMapDialog(CWnd* pParent = NULL); // standard constructor
Handle(Aspect_ColorMap) ColorMap() {return myColorMap;};
// Dialog Data
//{{AFX_DATA(CColorNewColorRampColorMapDialog)
enum { IDD = IDD_DIALOG_NewColorRamp };
CComboBox m_ColorList;
int m_base_pixel;
int m_dimension;
double m_Red;
double m_Green;
double m_Blue;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColorNewColorRampColorMapDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CColorNewColorRampColorMapDialog)
virtual void OnOK();
afx_msg void OnColorMapRampBUTTONEditColor();
virtual BOOL OnInitDialog();
afx_msg void OnChangeColorMapRampEDITColorRed();
afx_msg void OnChangeColorMapRampEDITColorGreen();
afx_msg void OnChangeColorMapRampEDITColorBlue();
afx_msg void OnSelchangeColorMapCOMBONewEntryColorName();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ColorNewColorRampColorMapDialog_H__A45F6973_DB41_11D1_8DE5_0800369C8A03__INCLUDED_)

View File

@@ -122,22 +122,19 @@ void CSelectionDialog::OnDisplay(bool isFit)
{
GetDlgItem(IDC_DUMMYBUTTON)->SetRedraw(true);
if(!myDisplay) {
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
((CHLRApp*)AfxGetApp())->GetGraphicDevice();
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
((CHLRApp*)AfxGetApp())->GetGraphicDriver();
myActiveViewer = new V3d_Viewer(theGraphicDevice,(short *) "Visu3D");
myActiveViewer = new V3d_Viewer(aGraphicDriver,(short *) "Visu3D");
myActiveViewer->SetDefaultLights();
myActiveViewer->SetLightOn();
myActiveView = myActiveViewer->CreateView();
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,
GetDlgItem(IDC_DUMMYBUTTON)->GetSafeHwnd(),
Quantity_NOC_GRAY);
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetDlgItem(IDC_DUMMYBUTTON)->GetSafeHwnd(),
Quantity_NOC_GRAY);
aWNTWindow->SetDoubleBuffer(Standard_False);
if (m_DegeneratedModeOn) myActiveView->SetDegenerateModeOn();
myActiveView->SetWindow(aWNTWindow);
if (m_DegeneratedModeOn) myActiveView->SetDegenerateModeOn();
myActiveView->SetWindow(aWNTWindow);
myInteractiveContext = new AIS_InteractiveContext(myActiveViewer);
@@ -210,7 +207,7 @@ void CSelectionDialog::OnGetShape()
void CSelectionDialog::Apply()
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myDoc->GetInteractiveContext2D()->EraseAll(Standard_False);
myDoc->GetInteractiveContext2D()->EraseAll(/*Standard_False*/);
UpdateData(true);
Standard_Integer DisplayMode = m_DisplayMode;
@@ -312,108 +309,112 @@ void CSelectionDialog::OnHApparentContour()
{ Apply(); }
void CSelectionDialog::OnChangeEDITNBIsos()
{
UpdateData(true);
myDisplayableShape->SetNbIsos(m_NbIsos);
Apply();
{
UpdateData(true);
myDisplayableShape->SetNbIsos(m_NbIsos);
Apply();
}
void CSelectionDialog::OnAlgo()
{ ShowHideButton();
{
ShowHideButton();
Apply();
}
void CSelectionDialog::OnPolyAlgo()
{ ShowHideButton();
{
ShowHideButton();
Apply();
}
void CSelectionDialog::OnDrawHiddenLine()
{
UpdateData(true);
if (m_DisplayMode >=6 )
{ m_DisplayMode=0;
UpdateData(false); }
ShowHideButton();
Apply();
if(m_DisplayMode >=6 )
{
m_DisplayMode=0;
UpdateData(false);
}
ShowHideButton();
Apply();
}
void CSelectionDialog::OnUpdate2D()
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myDoc->ActivateFrame(RUNTIME_CLASS(OCC_2dView),SW_NORMAL);
UpdateProjector();
Apply();
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myDoc->ActivateFrame(RUNTIME_CLASS(OCC_2dView),SW_NORMAL);
UpdateProjector();
Apply();
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
void CSelectionDialog::OnTopView()
{
myActiveView->SetProj(V3d_Zpos);
OnDisplay(true);
myActiveView->SetProj(V3d_Zpos);
OnDisplay(true);
}
void CSelectionDialog::OnBottomView()
{
myActiveView->SetProj(V3d_Zneg);
OnDisplay(true);
myActiveView->SetProj(V3d_Zneg);
OnDisplay(true);
}
void CSelectionDialog::OnLeftView()
{
myActiveView->SetProj(V3d_Ypos);
OnDisplay(true);
myActiveView->SetProj(V3d_Ypos);
OnDisplay(true);
}
void CSelectionDialog::OnRightView()
{
myActiveView->SetProj(V3d_Yneg);
OnDisplay(true);
myActiveView->SetProj(V3d_Yneg);
OnDisplay(true);
}
void CSelectionDialog::OnFrontView()
{
myActiveView->SetProj(V3d_Xpos);
OnDisplay(true);
myActiveView->SetProj(V3d_Xpos);
OnDisplay(true);
}
void CSelectionDialog::OnBackView()
{
myActiveView->SetProj(V3d_Xneg);
OnDisplay(true);
myActiveView->SetProj(V3d_Xneg);
OnDisplay(true);
}
void CSelectionDialog::OnAxoView()
{
myActiveView->SetProj(V3d_XposYnegZpos);
OnDisplay(true);
myActiveView->SetProj(V3d_XposYnegZpos);
OnDisplay(true);
}
void CSelectionDialog::OnDegeneratedMode()
{
UpdateData(true);
UpdateData(true);
if(m_DegeneratedModeOn)
{
myActiveView->SetDegenerateModeOn();
m_DegeneratedModeOn = Standard_True;
}
else
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myActiveView->SetDegenerateModeOff();
m_DegeneratedModeOn = Standard_False;
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
OnDisplay(false);
if(m_DegeneratedModeOn)
{
myActiveView->SetDegenerateModeOn();
m_DegeneratedModeOn = Standard_True;
}
else
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myActiveView->SetDegenerateModeOff();
m_DegeneratedModeOn = Standard_False;
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
OnDisplay(false);
}
void CSelectionDialog::OnLButtonDown(UINT nFlags, CPoint point)
{
CDialog::OnLButtonDown(nFlags, point);
CDialog::OnLButtonDown(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
// save the current mouse coordinate
myXmax=point.x; myYmax=point.y;
@@ -421,91 +422,88 @@ void CSelectionDialog::OnLButtonDown(UINT nFlags, CPoint point)
void CSelectionDialog::OnLButtonUp(UINT nFlags, CPoint point)
{
CDialog::OnLButtonUp(nFlags, point);
CDialog::OnLButtonUp(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
}
void CSelectionDialog::OnRButtonDown(UINT nFlags, CPoint point)
{
CDialog::OnRButtonDown(nFlags, point);
CDialog::OnRButtonDown(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
if ( nFlags & CASCADESHORTCUTKEY )
{
if (!m_DegeneratedModeOn)
myActiveView->SetDegenerateModeOn();
myActiveView->StartRotation(point.x,point.y);
OnDisplay(false);
}
if ( nFlags & CASCADESHORTCUTKEY )
{
if (!m_DegeneratedModeOn)
myActiveView->SetDegenerateModeOn();
myActiveView->StartRotation(point.x,point.y);
OnDisplay(false);
}
}
void CSelectionDialog::OnRButtonUp(UINT nFlags, CPoint point)
{
CDialog::OnRButtonUp(nFlags, point);
CDialog::OnRButtonUp(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
// reset tyhe good Degenerated mode according to the strored one
// --> dynamic rotation may have change it
if (!m_DegeneratedModeOn)
myActiveView->SetDegenerateModeOff();
else
myActiveView->SetDegenerateModeOn();
OnDisplay(false);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
// reset tyhe good Degenerated mode according to the strored one
// --> dynamic rotation may have change it
if (!m_DegeneratedModeOn)
myActiveView->SetDegenerateModeOff();
else
myActiveView->SetDegenerateModeOn();
OnDisplay(false);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
void CSelectionDialog::OnMouseMove(UINT nFlags, CPoint point)
{
CDialog::OnMouseMove(nFlags, point);
CDialog::OnMouseMove(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
if ((myPosMinX > point.x)||(myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y))
return;
// ============================ LEFT BUTTON =======================
if ( nFlags & MK_LBUTTON)
{//left button
if ( nFlags & CASCADESHORTCUTKEY )
{
if ( nFlags & CASCADESHORTCUTKEY )
{
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myActiveView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate
myXmax = point.x; myYmax = point.y;
}// if ( nFlags & CASCADESHORTCUTKEY ) else
} else // if ( nFlags & MK_LBUTTON)
// ============================ MIDDLE BUTTON =======================
if ( nFlags & MK_MBUTTON)
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myActiveView->Zoom(myXmax,myYmax,point.x,point.y);
// save the current mouse coordinate
myXmax = point.x; myYmax = point.y;
}// if ( nFlags & CASCADESHORTCUTKEY ) else
}
else if ( nFlags & MK_MBUTTON)
{
if ( nFlags & CASCADESHORTCUTKEY )
{
if ( nFlags & CASCADESHORTCUTKEY )
{
myActiveView->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)
myActiveView->Pan(point.x-myXmax,myYmax-point.y); // Realize the panning
myXmax = point.x; myYmax = point.y;
}
}
else if ( nFlags & MK_RBUTTON)
{//right button
if ( nFlags & CASCADESHORTCUTKEY )
{
if ( nFlags & CASCADESHORTCUTKEY )
{
myActiveView->Rotation(point.x,point.y);
}
} else //if ( nFlags & MK_RBUTTON)
// ============================ NO BUTTON =======================
{ // No buttons
myXmax = point.x; myYmax = point.y;
}
OnDisplay(false);
myActiveView->Rotation(point.x,point.y);
}
}
else
{// No buttons
myXmax = point.x; myYmax = point.y;
}
OnDisplay(false);
}
void CSelectionDialog::OnOK()
@@ -515,7 +513,6 @@ void CSelectionDialog::OnOK()
void CSelectionDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
OnDisplay(false);
CPaintDC dc(this); // device context for painting
OnDisplay(false);
}

View File

@@ -16,95 +16,95 @@ class CHLRDoc;
class CSelectionDialog : public CDialog
{
// Construction
// Construction
public:
void SetTitle(CString& aTitle);
CSelectionDialog(CHLRDoc* aDoc,CWnd* pParent = NULL); // standard constructor
void OnDisplay(bool isfit);
void SetTitle(CString& aTitle);
CSelectionDialog(CHLRDoc* aDoc,CWnd* pParent = NULL); // standard constructor
void OnDisplay(bool isfit);
// Dialog Data
//{{AFX_DATA(CSelectionDialog)
enum { IDD = IDD_SelectionDialog };
int m_Algo;
int m_DisplayMode;
int m_NbIsos;
BOOL m_DrawHiddenLine;
BOOL m_DegeneratedModeOn;
//}}AFX_DATA
// Dialog Data
//{{AFX_DATA(CSelectionDialog)
enum { IDD = IDD_SelectionDialog };
int m_Algo;
int m_DisplayMode;
int m_NbIsos;
BOOL m_DrawHiddenLine;
BOOL m_DegeneratedModeOn;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSelectionDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSelectionDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
// Implementation
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSelectionDialog)
virtual BOOL OnInitDialog();
afx_msg void OnGetShape();
afx_msg void OnDisplayDefault();
afx_msg void OnVIsoParametrics();
afx_msg void OnVApparentContour();
afx_msg void OnVSewingEdges();
afx_msg void OnVsharpEdges();
afx_msg void OnVsmoothEdges();
afx_msg void OnHsharpEdges();
afx_msg void OnHsmoothEdges();
afx_msg void OnHSewingEdges();
afx_msg void OnHIsoParametrics();
afx_msg void OnHApparentContour();
afx_msg void OnChangeEDITNBIsos();
afx_msg void OnAlgo();
afx_msg void OnPolyAlgo();
afx_msg void OnUpdate2D();
afx_msg void OnTopView();
afx_msg void OnBottomView();
afx_msg void OnLeftView();
afx_msg void OnRightView();
afx_msg void OnFrontView();
afx_msg void OnBackView();
afx_msg void OnAxoView();
virtual void OnOK();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(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 OnDrawHiddenLine();
afx_msg void OnDegeneratedMode();
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// Generated message map functions
//{{AFX_MSG(CSelectionDialog)
virtual BOOL OnInitDialog();
afx_msg void OnGetShape();
afx_msg void OnDisplayDefault();
afx_msg void OnVIsoParametrics();
afx_msg void OnVApparentContour();
afx_msg void OnVSewingEdges();
afx_msg void OnVsharpEdges();
afx_msg void OnVsmoothEdges();
afx_msg void OnHsharpEdges();
afx_msg void OnHsmoothEdges();
afx_msg void OnHSewingEdges();
afx_msg void OnHIsoParametrics();
afx_msg void OnHApparentContour();
afx_msg void OnChangeEDITNBIsos();
afx_msg void OnAlgo();
afx_msg void OnPolyAlgo();
afx_msg void OnUpdate2D();
afx_msg void OnTopView();
afx_msg void OnBottomView();
afx_msg void OnLeftView();
afx_msg void OnRightView();
afx_msg void OnFrontView();
afx_msg void OnBackView();
afx_msg void OnAxoView();
virtual void OnOK();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(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 OnDrawHiddenLine();
afx_msg void OnDegeneratedMode();
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private :
void UpdateProjector();
void ShowHideButton(Standard_Boolean EnableButton=Standard_True;);
void Apply();
CHLRDoc* myDoc;
void UpdateProjector();
void ShowHideButton(Standard_Boolean EnableButton=Standard_True;);
void Apply();
CHLRDoc* myDoc;
Handle(V3d_Viewer) myActiveViewer ;
Handle(V3d_View) myActiveView;
Standard_Integer myPosMaxX, myPosMinX ,myBoxX;
Standard_Integer myPosMinY, myPosMaxY ,myBoxY;
Standard_Integer myXmax;
Standard_Integer myYmax;
Handle(V3d_Viewer) myActiveViewer;
Handle(V3d_View) myActiveView;
Standard_Integer myPosMaxX, myPosMinX ,myBoxX;
Standard_Integer myPosMinY, myPosMaxY ,myBoxY;
Standard_Integer myXmax;
Standard_Integer myYmax;
Handle(AIS_InteractiveContext) myInteractiveContext;
Handle(AIS_Trihedron) myTrihedron;
Handle(ISession2D_Shape) myDisplayableShape;
Handle(AIS_InteractiveContext) myInteractiveContext;
Handle(AIS_Trihedron) myTrihedron;
Handle(ISession2D_Shape) myDisplayableShape;
protected:
CBitmapButton TopView ;
CBitmapButton BottomView ;
CBitmapButton LeftView ;
CBitmapButton RightView ;
CBitmapButton FrontView ;
CBitmapButton BackView ;
CBitmapButton AxoView ;
bool myDisplay;
CBitmapButton TopView ;
CBitmapButton BottomView ;
CBitmapButton LeftView ;
CBitmapButton RightView ;
CBitmapButton FrontView ;
CBitmapButton BackView ;
CBitmapButton AxoView ;
bool myDisplay;
};
//{{AFX_INSERT_LOCATION}}

View File

@@ -143,36 +143,18 @@
#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <Graphic2d_Array1OfVertex.hxx>
#include <Graphic2d_Buffer.hxx>
#include <Graphic2d_CircleMarker.hxx>
#include <Graphic2d_DisplayList.hxx>
#include <Graphic2d_Drawer.hxx>
#include <Graphic2d_PolyLine.hxx>
#include <Graphic2d_Segment.hxx>
#include <Graphic2d_SetOfCurves.hxx>
#include <Graphic2d_SetOfSegments.hxx>
#include <Graphic2d_Text.hxx>
#include <Graphic2d_Vertex.hxx>
#include <Graphic2d_View.hxx>
#include <Graphic3d_WNTGraphicDevice.hxx>
#include <MMgt_TShared.hxx>
#include <OSD_Environment.hxx>
#include <Precision.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Text.hxx>
#include <PrsMgr_PresentationManager2d.hxx>
#include <Quantity_Factor.hxx>
#include <Quantity_Length.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Quantity_PhysicalQuantity.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <Select2D_SensitiveArc.hxx>
#include <Select2D_SensitiveBox.hxx>
#include <Select2D_SensitiveEntity.hxx>
#include <Select2D_SensitiveSegment.hxx>
#include <SelectBasics_BasicTool.hxx>
#include <SelectBasics_ListOfBox2d.hxx>
#include <SelectMgr_EntityOwner.hxx>
@@ -180,12 +162,6 @@
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SelectionManager.hxx>
// for opencasdade
//#include <Session_Selection.hxx>
//#include <Session_Session.hxx>
//#include <ShapeSchema.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_ErrorHandler.hxx>
@@ -198,9 +174,6 @@
#include <StdPrs_Curve.hxx>
#include <StdPrs_Point.hxx>
#include <StdPrs_PoleCurve.hxx>
#include <StdSelect_SensitiveText2d.hxx>
#include <StdSelect_TextProjector2d.hxx>
#include <StdSelect_ViewerSelector2d.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
@@ -216,11 +189,8 @@
#include <TopoDS_Solid.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <UnitsAPI.hxx>
#include <V2d_View.hxx>
#include <V2d_Viewer.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
#include <WNT_WDriver.hxx>
#include <WNT_Window.hxx>
#include <HLRAlgo_Projector.hxx>