mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0024372: HLR Sample: erased objects are shown in HLR
Compilation errors were corrected. Removed .aps files Sample paths fields were updated to read help file from sample folder.
This commit is contained in:
parent
ef2d8af761
commit
b3837d74e0
Binary file not shown.
@ -18,6 +18,7 @@
|
|||||||
CGeometryApp::CGeometryApp() : OCC_App()
|
CGeometryApp::CGeometryApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "Geometry"; //for about dialog
|
SampleName = "Geometry"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\01_Geometry");
|
||||||
}
|
}
|
||||||
|
|
||||||
CGeometryApp::~CGeometryApp()
|
CGeometryApp::~CGeometryApp()
|
||||||
|
Binary file not shown.
@ -18,6 +18,7 @@
|
|||||||
CModelingApp::CModelingApp() : OCC_App()
|
CModelingApp::CModelingApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "Modeling"; //for about dialog
|
SampleName = "Modeling"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\02_Modeling");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Viewer2d sample demonstrates how the functionality of TKV3d package can be used
|
Viewer2d sample demonstrates how the functionality of TKV3d package can be
|
||||||
for 2D visualization. It provides samples of 2D objects visualization,
|
used for 2D visualization. It provides samples of 2D objects visualization,
|
||||||
dynamic selection and highlighting.
|
dynamic selection and highlighting.
|
||||||
It illustratea how to:
|
It illustrates how to:
|
||||||
1) implement 2D view behavior with V3d_View class, with interactive zooming and
|
1) implement 2D view behavior with V3d_View class, with interactive zooming
|
||||||
panning of the 2D scene;
|
and panning of the 2D scene;
|
||||||
2) draw 2D primitives like rectangles, lines, curves;
|
2) draw 2D primitives like rectangles, lines, curves;
|
||||||
3) draw different types of markers;
|
3) draw different types of markers;
|
||||||
4) draw text defined by its font, height, style, angle;
|
4) draw text defined by its font, height, style, angle;
|
||||||
|
Binary file not shown.
@ -22,6 +22,7 @@ static char THIS_FILE[] = __FILE__;
|
|||||||
CViewer2dApp::CViewer2dApp() : OCC_App()
|
CViewer2dApp::CViewer2dApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "Viewer2d"; //for about dialog
|
SampleName = "Viewer2d"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\03_Viewer2d");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -29,6 +29,7 @@ END_MESSAGE_MAP()
|
|||||||
CViewer3dApp::CViewer3dApp() : OCC_App()
|
CViewer3dApp::CViewer3dApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "Viewer3d"; //for about dialog
|
SampleName = "Viewer3d"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\03_Viewer3d");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Binary file not shown.
@ -33,6 +33,7 @@ CImportExportApp::CImportExportApp() : OCC_App()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SampleName = "ImportExport"; //for about dialog
|
SampleName = "ImportExport"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\05_ImportExport");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Binary file not shown.
@ -35,9 +35,9 @@ END_MESSAGE_MAP()
|
|||||||
|
|
||||||
COcafApp::COcafApp() : OCC_App()
|
COcafApp::COcafApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SetSamplePath("06_Ocaf");
|
|
||||||
myApp = new TOcaf_Application();
|
myApp = new TOcaf_Application();
|
||||||
SampleName = "OCAF"; //for about dialog
|
SampleName = "OCAF"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\06_Ocaf");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
@ -16,6 +16,7 @@
|
|||||||
CTriangulationApp::CTriangulationApp() : OCC_App()
|
CTriangulationApp::CTriangulationApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "TopologyTriangulation"; //for about dialog
|
SampleName = "TopologyTriangulation"; //for about dialog
|
||||||
|
SetSamplePath("..\\..\\07_Triangulation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
12
samples/mfc/standard/08_HLR/README.txt
Normal file
12
samples/mfc/standard/08_HLR/README.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
HLR sample demonstrates hidden line removal algorithm.
|
||||||
|
It supports exact and polygonal HLR algorihms.
|
||||||
|
|
||||||
|
To try HLR you need to follow some steps:
|
||||||
|
1) to import model, which will displayed in 3d view.
|
||||||
|
2) to choose "File->Process HLR" or press "HLR' button in the toolbar.
|
||||||
|
Dialog with options of HLR will be opened.
|
||||||
|
3) to press "Get shapes" button of the HLR dialog to
|
||||||
|
display results in the 2d view.
|
||||||
|
Optionally, this dialog allow to view chosen shapes
|
||||||
|
in his own view. Here you can choose needed direction
|
||||||
|
of view and press "Update 2d" button to update shapes HLR 2d view.
|
Binary file not shown.
@ -343,6 +343,7 @@ BEGIN
|
|||||||
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
|
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
|
||||||
MENUITEM "&Close", ID_FILE_CLOSE
|
MENUITEM "&Close", ID_FILE_CLOSE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "Process HLR", ID_FILE_HLR
|
||||||
POPUP "Import"
|
POPUP "Import"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "BRep...", ID_FILE_IMPORT_BREP
|
MENUITEM "BRep...", ID_FILE_IMPORT_BREP
|
||||||
@ -443,7 +444,8 @@ END
|
|||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
ID_BUTTON_HLRDialog "Display The HLR Dialog \nHLR Dialog"
|
ID_BUTTON_HLRDialog "Open the HLR dialog \nHLR dialog"
|
||||||
|
ID_FILE_HLR "Open the HLR dialog \nHLR dialog"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
|
@ -111,7 +111,8 @@
|
|||||||
#define IDC_BackView 1534
|
#define IDC_BackView 1534
|
||||||
#define IDC_FrontView 1535
|
#define IDC_FrontView 1535
|
||||||
#define IDC_AxoView 1536
|
#define IDC_AxoView 1536
|
||||||
#define ID_BUTTON_HLRDialog 32795
|
#define ID_BUTTON_HLRDialog 1537
|
||||||
|
#define ID_FILE_HLR 1539
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
@ -119,7 +120,7 @@
|
|||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_3D_CONTROLS 1
|
#define _APS_3D_CONTROLS 1
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 173
|
#define _APS_NEXT_RESOURCE_VALUE 173
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32796
|
#define _APS_NEXT_COMMAND_VALUE 32797
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1538
|
#define _APS_NEXT_CONTROL_VALUE 1538
|
||||||
#define _APS_NEXT_SYMED_VALUE 170
|
#define _APS_NEXT_SYMED_VALUE 170
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,6 +28,7 @@ static char THIS_FILE[] = __FILE__;
|
|||||||
CHLRApp::CHLRApp() : OCC_App()
|
CHLRApp::CHLRApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "HLR"; //for about dialog
|
SampleName = "HLR"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\08_HLR");
|
||||||
}
|
}
|
||||||
|
|
||||||
CHLRApp::~CHLRApp()
|
CHLRApp::~CHLRApp()
|
||||||
|
@ -30,8 +30,10 @@ BEGIN_MESSAGE_MAP(CHLRDoc, OCC_3dBaseDoc)
|
|||||||
//{{AFX_MSG_MAP(CHLRDoc)
|
//{{AFX_MSG_MAP(CHLRDoc)
|
||||||
ON_COMMAND(ID_WINDOW_NEW3D, OnWindowNew3d)
|
ON_COMMAND(ID_WINDOW_NEW3D, OnWindowNew3d)
|
||||||
ON_COMMAND(ID_WINDOW_NEW2D, OnWindowNew2d)
|
ON_COMMAND(ID_WINDOW_NEW2D, OnWindowNew2d)
|
||||||
|
ON_COMMAND(ID_FILE_HLR, OnBUTTONHLRDialog)
|
||||||
ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep)
|
ON_COMMAND(ID_FILE_IMPORT_BREP, OnFileImportBrep)
|
||||||
ON_COMMAND(ID_BUTTON_HLRDialog, OnBUTTONHLRDialog)
|
ON_COMMAND(ID_BUTTON_HLRDialog, OnBUTTONHLRDialog)
|
||||||
|
ON_COMMAND(ID_OBJECT_ERASE, OnObjectErase)
|
||||||
//}}AFX_MSG_MAP
|
//}}AFX_MSG_MAP
|
||||||
|
|
||||||
|
|
||||||
@ -181,3 +183,25 @@ void CHLRDoc::Fit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHLRDoc::OnObjectErase()
|
||||||
|
{
|
||||||
|
Standard_Boolean toUpdateDisplayable = Standard_False;
|
||||||
|
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
||||||
|
{
|
||||||
|
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
||||||
|
if (myAISContext->Current()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated)
|
||||||
|
{
|
||||||
|
myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->Current())->Shape());
|
||||||
|
toUpdateDisplayable = Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
myAISContext->ClearCurrents();
|
||||||
|
|
||||||
|
if (toUpdateDisplayable)
|
||||||
|
{
|
||||||
|
// Update view in the HLR dialog if list of displayable shapes has been changed.
|
||||||
|
myCSelectionDialog->UpdateViews();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ protected:
|
|||||||
afx_msg void OnWindowNew2d();
|
afx_msg void OnWindowNew2d();
|
||||||
afx_msg void OnFileImportBrep();
|
afx_msg void OnFileImportBrep();
|
||||||
afx_msg void OnBUTTONHLRDialog();
|
afx_msg void OnBUTTONHLRDialog();
|
||||||
|
afx_msg void OnObjectErase();
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ CSelectionDialog::CSelectionDialog(CHLRDoc* aDoc,CWnd* pParent /*=NULL*/)
|
|||||||
: CDialog(CSelectionDialog::IDD, pParent)
|
: CDialog(CSelectionDialog::IDD, pParent)
|
||||||
{
|
{
|
||||||
myDoc = aDoc;
|
myDoc = aDoc;
|
||||||
myDisplay = false;
|
myIsDisplayed = false;
|
||||||
//{{AFX_DATA_INIT(CSelectionDialog)
|
//{{AFX_DATA_INIT(CSelectionDialog)
|
||||||
m_Algo = 0;
|
m_Algo = 0;
|
||||||
m_DisplayMode = 0;
|
m_DisplayMode = 0;
|
||||||
@ -51,7 +51,7 @@ void CSelectionDialog::DoDataExchange(CDataExchange* pDX)
|
|||||||
|
|
||||||
BEGIN_MESSAGE_MAP(CSelectionDialog, CDialog)
|
BEGIN_MESSAGE_MAP(CSelectionDialog, CDialog)
|
||||||
//{{AFX_MSG_MAP(CSelectionDialog)
|
//{{AFX_MSG_MAP(CSelectionDialog)
|
||||||
ON_BN_CLICKED(ID_GetShape, OnGetShape)
|
ON_BN_CLICKED(ID_GetShape, OnGetSelectedShapes)
|
||||||
ON_BN_CLICKED(IDC_DisplayDefault, OnDisplayDefault)
|
ON_BN_CLICKED(IDC_DisplayDefault, OnDisplayDefault)
|
||||||
ON_BN_CLICKED(IDC_VIsoParametrics, OnVIsoParametrics)
|
ON_BN_CLICKED(IDC_VIsoParametrics, OnVIsoParametrics)
|
||||||
ON_BN_CLICKED(IDC_VApparentContour, OnVApparentContour)
|
ON_BN_CLICKED(IDC_VApparentContour, OnVApparentContour)
|
||||||
@ -114,14 +114,16 @@ BOOL CSelectionDialog::OnInitDialog()
|
|||||||
ShowHideButton (Standard_False);
|
ShowHideButton (Standard_False);
|
||||||
OnDisplay (true);
|
OnDisplay (true);
|
||||||
|
|
||||||
return TRUE; // return TRUE unless you set the focus to a control
|
// return TRUE unless you set the focus to a control
|
||||||
// EXCEPTION: OCX Property Pages should return FALSE
|
// EXCEPTION: OCX Property Pages should return FALSE
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSelectionDialog::OnDisplay (bool isFit)
|
void CSelectionDialog::OnDisplay (bool isFit)
|
||||||
{
|
{
|
||||||
GetDlgItem(IDC_DUMMYBUTTON)->SetRedraw (true);
|
GetDlgItem(IDC_DUMMYBUTTON)->SetRedraw (true);
|
||||||
if(!myDisplay) {
|
if (!myIsDisplayed)
|
||||||
|
{
|
||||||
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
|
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
|
||||||
((CHLRApp*)AfxGetApp())->GetGraphicDriver();
|
((CHLRApp*)AfxGetApp())->GetGraphicDriver();
|
||||||
|
|
||||||
@ -143,30 +145,63 @@ void CSelectionDialog::OnDisplay(bool isFit)
|
|||||||
|
|
||||||
myInteractiveContext->Display (myTrihedron);
|
myInteractiveContext->Display (myTrihedron);
|
||||||
}
|
}
|
||||||
if(isFit) {
|
if(isFit)
|
||||||
|
{
|
||||||
myActiveView->ZFitAll();
|
myActiveView->ZFitAll();
|
||||||
myActiveView->FitAll();
|
myActiveView->FitAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
myActiveView->Redraw();
|
myActiveView->Redraw();
|
||||||
myDisplay = Standard_True;
|
myIsDisplayed = Standard_True;
|
||||||
GetDlgItem (IDC_DUMMYBUTTON)->SetRedraw (false);
|
GetDlgItem (IDC_DUMMYBUTTON)->SetRedraw (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CSelectionDialog::SetTitle(CString & aTitle)
|
void CSelectionDialog::SetTitle (const CString & aTitle)
|
||||||
{
|
{
|
||||||
SetWindowText (aTitle);
|
SetWindowText (aTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSelectionDialog::OnGetShape()
|
void CSelectionDialog::UpdateViews()
|
||||||
{
|
{
|
||||||
UpdateData(true);
|
// Clear HLR dialog view
|
||||||
myDoc->GetInteractiveContext2D()->RemoveAll();
|
myInteractiveContext->RemoveAll();
|
||||||
|
myInteractiveContext->Display (myTrihedron);
|
||||||
|
|
||||||
|
UpdateProjector();
|
||||||
|
|
||||||
|
// Display chosen shapes in the HLR dialog view.
|
||||||
|
Standard_Boolean OneOrMoreFound = Standard_False;
|
||||||
|
for (myDoc->GetAISContext()->InitCurrent();
|
||||||
|
myDoc->GetAISContext()->MoreCurrent();
|
||||||
|
myDoc->GetAISContext()->NextCurrent())
|
||||||
|
{
|
||||||
|
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->Current());
|
||||||
|
if (!anAISShape.IsNull())
|
||||||
|
{
|
||||||
|
OneOrMoreFound = Standard_True;
|
||||||
|
myInteractiveContext->Display (anAISShape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply HLR to chosen shapes and display result into the 2d view.
|
||||||
|
Apply();
|
||||||
|
// Update viewer
|
||||||
|
myDoc->FitAll2DViews (Standard_False);
|
||||||
|
// Check the selection: if no object : disable all possiblity.
|
||||||
|
ShowHideButton (OneOrMoreFound);
|
||||||
|
OnDisplay (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSelectionDialog::OnGetSelectedShapes()
|
||||||
|
{
|
||||||
|
// Create new displayable shape.
|
||||||
myDisplayableShape = new ISession2D_Shape();
|
myDisplayableShape = new ISession2D_Shape();
|
||||||
UpdateProjector();
|
UpdateProjector();
|
||||||
myDisplayableShape->SetNbIsos (m_NbIsos);
|
myDisplayableShape->SetNbIsos (m_NbIsos);
|
||||||
|
|
||||||
myInteractiveContext->EraseAll();
|
// Clear HLR dialog view
|
||||||
|
myInteractiveContext->RemoveAll();
|
||||||
myInteractiveContext->Display (myTrihedron);
|
myInteractiveContext->Display (myTrihedron);
|
||||||
|
|
||||||
Standard_Boolean OneOrMoreFound = Standard_False;
|
Standard_Boolean OneOrMoreFound = Standard_False;
|
||||||
@ -185,19 +220,12 @@ void CSelectionDialog::OnGetShape()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer DisplayMode = m_DisplayMode;
|
// Apply HLR to chosen shapes and display result into the 2d view.
|
||||||
if (m_Algo == 1) DisplayMode+=100;
|
Apply();
|
||||||
if (!m_DrawHiddenLine) DisplayMode+=1000;
|
// Update viewer
|
||||||
|
myDoc->FitAll2DViews (Standard_False);
|
||||||
|
|
||||||
myDoc->GetInteractiveContext2D()->Display(myDisplayableShape, // object
|
// Check the selection: if no object : disable all possiblity.
|
||||||
DisplayMode, // display mode
|
|
||||||
DisplayMode, // selection mode
|
|
||||||
Standard_True); // Redraw
|
|
||||||
|
|
||||||
myDoc->FitAll2DViews(Standard_False); // Update Viewer
|
|
||||||
|
|
||||||
// check the selection :
|
|
||||||
// if no object : disable all possiblity!!
|
|
||||||
ShowHideButton (OneOrMoreFound);
|
ShowHideButton (OneOrMoreFound);
|
||||||
OnDisplay (true);
|
OnDisplay (true);
|
||||||
}
|
}
|
||||||
@ -208,14 +236,21 @@ void CSelectionDialog::Apply()
|
|||||||
myDoc->GetInteractiveContext2D()->RemoveAll();
|
myDoc->GetInteractiveContext2D()->RemoveAll();
|
||||||
UpdateData (true);
|
UpdateData (true);
|
||||||
|
|
||||||
Standard_Integer DisplayMode = m_DisplayMode;
|
Standard_Integer aDisplayMode = m_DisplayMode;
|
||||||
if (m_Algo == 1) DisplayMode+=100;
|
|
||||||
|
|
||||||
if (!m_DrawHiddenLine) DisplayMode+=1000;
|
if (m_Algo == 1)
|
||||||
|
{
|
||||||
|
aDisplayMode += 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_DrawHiddenLine)
|
||||||
|
{
|
||||||
|
aDisplayMode += 1000;
|
||||||
|
}
|
||||||
|
|
||||||
myDoc->GetInteractiveContext2D()->Display (myDisplayableShape, // object
|
myDoc->GetInteractiveContext2D()->Display (myDisplayableShape, // object
|
||||||
DisplayMode,
|
aDisplayMode,
|
||||||
DisplayMode,
|
aDisplayMode,
|
||||||
Standard_True); // Redraw
|
Standard_True); // Redraw
|
||||||
|
|
||||||
SetCursor(AfxGetApp()->LoadStandardCursor (IDC_ARROW));
|
SetCursor(AfxGetApp()->LoadStandardCursor (IDC_ARROW));
|
||||||
@ -265,8 +300,10 @@ void CSelectionDialog::ShowHideButton(Standard_Boolean EnableButton)
|
|||||||
|
|
||||||
if(m_Algo == 0)
|
if(m_Algo == 0)
|
||||||
{
|
{
|
||||||
if (m_DisplayMode == 5) m_DisplayMode=0;
|
if (m_DisplayMode == 5 || m_DisplayMode == 10)
|
||||||
if (m_DisplayMode == 10) m_DisplayMode=0;
|
{
|
||||||
|
m_DisplayMode=0;
|
||||||
|
}
|
||||||
|
|
||||||
GetDlgItem(IDC_VIsoParametrics)->EnableWindow(false);
|
GetDlgItem(IDC_VIsoParametrics)->EnableWindow(false);
|
||||||
GetDlgItem(IDC_HIsoParametrics)->EnableWindow(false);
|
GetDlgItem(IDC_HIsoParametrics)->EnableWindow(false);
|
||||||
@ -458,7 +495,7 @@ void CSelectionDialog::OnRButtonUp(UINT nFlags, CPoint point)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
||||||
// reset tyhe good HLR mode according to the strored one
|
// reset the good HLR mode according to the stored one
|
||||||
// --> dynamic rotation may have change it
|
// --> dynamic rotation may have change it
|
||||||
myActiveView->SetComputedMode (m_HlrModeIsOn);
|
myActiveView->SetComputedMode (m_HlrModeIsOn);
|
||||||
OnDisplay(false);
|
OnDisplay(false);
|
||||||
|
@ -18,9 +18,17 @@ class CSelectionDialog : public CDialog
|
|||||||
{
|
{
|
||||||
// Construction
|
// Construction
|
||||||
public:
|
public:
|
||||||
void SetTitle(CString& aTitle);
|
// standard constructor
|
||||||
CSelectionDialog(CHLRDoc* aDoc,CWnd* pParent = NULL); // standard constructor
|
CSelectionDialog (CHLRDoc* aDoc,CWnd* pParent = NULL);
|
||||||
void OnDisplay(bool isfit);
|
|
||||||
|
void SetTitle (const CString& aTitle);
|
||||||
|
|
||||||
|
void OnDisplay (bool isFit);
|
||||||
|
|
||||||
|
const Handle(ISession2D_Shape) DiplayableShape() { return myDisplayableShape; }
|
||||||
|
|
||||||
|
// Updates in dialog view and main 2d nad 3d views shapes for which HLR presentations are going to be displayed in 2d view.
|
||||||
|
void UpdateViews();
|
||||||
|
|
||||||
// Dialog Data
|
// Dialog Data
|
||||||
//{{AFX_DATA(CSelectionDialog)
|
//{{AFX_DATA(CSelectionDialog)
|
||||||
@ -45,7 +53,7 @@ protected:
|
|||||||
// Generated message map functions
|
// Generated message map functions
|
||||||
//{{AFX_MSG(CSelectionDialog)
|
//{{AFX_MSG(CSelectionDialog)
|
||||||
virtual BOOL OnInitDialog();
|
virtual BOOL OnInitDialog();
|
||||||
afx_msg void OnGetShape();
|
afx_msg void OnGetSelectedShapes();
|
||||||
afx_msg void OnDisplayDefault();
|
afx_msg void OnDisplayDefault();
|
||||||
afx_msg void OnVIsoParametrics();
|
afx_msg void OnVIsoParametrics();
|
||||||
afx_msg void OnVApparentContour();
|
afx_msg void OnVApparentContour();
|
||||||
@ -85,17 +93,23 @@ private :
|
|||||||
void Apply();
|
void Apply();
|
||||||
CHLRDoc* myDoc;
|
CHLRDoc* myDoc;
|
||||||
|
|
||||||
|
Handle(AIS_InteractiveContext) myInteractiveContext;
|
||||||
Handle(V3d_Viewer) myActiveViewer;
|
Handle(V3d_Viewer) myActiveViewer;
|
||||||
Handle(V3d_View) myActiveView;
|
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(AIS_Trihedron) myTrihedron;
|
||||||
Handle(ISession2D_Shape) myDisplayableShape;
|
Handle(ISession2D_Shape) myDisplayableShape;
|
||||||
|
|
||||||
|
Standard_Integer myPosMaxX;
|
||||||
|
Standard_Integer myPosMinX;
|
||||||
|
Standard_Integer myBoxX;
|
||||||
|
|
||||||
|
Standard_Integer myPosMinY;
|
||||||
|
Standard_Integer myPosMaxY;
|
||||||
|
Standard_Integer myBoxY;
|
||||||
|
|
||||||
|
Standard_Integer myXmax;
|
||||||
|
Standard_Integer myYmax;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CBitmapButton TopView;
|
CBitmapButton TopView;
|
||||||
CBitmapButton BottomView;
|
CBitmapButton BottomView;
|
||||||
@ -104,7 +118,7 @@ protected:
|
|||||||
CBitmapButton FrontView;
|
CBitmapButton FrontView;
|
||||||
CBitmapButton BackView;
|
CBitmapButton BackView;
|
||||||
CBitmapButton AxoView;
|
CBitmapButton AxoView;
|
||||||
bool myDisplay;
|
bool myIsDisplayed;
|
||||||
};
|
};
|
||||||
|
|
||||||
//{{AFX_INSERT_LOCATION}}
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
Binary file not shown.
@ -26,6 +26,7 @@ END_MESSAGE_MAP()
|
|||||||
CAnimationApp::CAnimationApp() : OCC_App()
|
CAnimationApp::CAnimationApp() : OCC_App()
|
||||||
{
|
{
|
||||||
SampleName = "Animation"; //for about dialog
|
SampleName = "Animation"; //for about dialog
|
||||||
|
SetSamplePath ("..\\..\\09_Animation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -360,7 +360,7 @@ void CAnimationDoc::OnFileLoadgrid()
|
|||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
CString initdir(((OCC_App*) AfxGetApp())->GetInitDataDir());
|
CString initdir(((OCC_App*) AfxGetApp())->GetInitDataDir());
|
||||||
initdir += "\\..\\..\\Data\\";
|
initdir += "\\Data\\";
|
||||||
|
|
||||||
dlg.m_ofn.lpstrInitialDir = initdir;
|
dlg.m_ofn.lpstrInitialDir = initdir;
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ Convert_Presentation::Convert_Presentation()
|
|||||||
void Convert_Presentation::DoSample()
|
void Convert_Presentation::DoSample()
|
||||||
{
|
{
|
||||||
((COCCDemoApp*) AfxGetApp())->SetSampleName("Convert");
|
((COCCDemoApp*) AfxGetApp())->SetSampleName("Convert");
|
||||||
|
((COCCDemoApp*) AfxGetApp())->SetSamplePath("..\\..\\10_Convert");
|
||||||
getAISContext()->EraseAll();
|
getAISContext()->EraseAll();
|
||||||
if (myIndex >=0 && myIndex < myNbFuncs)
|
if (myIndex >=0 && myIndex < myNbFuncs)
|
||||||
(this->*SampleFuncs[myIndex])();
|
(this->*SampleFuncs[myIndex])();
|
||||||
|
@ -21,6 +21,23 @@ void ISession2D_Shape::Add(const TopoDS_Shape& aShape)
|
|||||||
Update(); // protected method used to specify that the presentation are not up to date
|
Update(); // protected method used to specify that the presentation are not up to date
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ISession2D_Shape::Remove (const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
if (myListOfShape.Size() == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (NCollection_List<TopoDS_Shape>::Iterator anIt (myListOfShape); anIt.More(); anIt.Next())
|
||||||
|
{
|
||||||
|
if (anIt.Value() == theShape)
|
||||||
|
{
|
||||||
|
myListOfShape.Remove (anIt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
|
void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
|
||||||
{
|
{
|
||||||
myProjector= aProjector;
|
myProjector= aProjector;
|
||||||
@ -48,7 +65,7 @@ void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos)
|
|||||||
void ISession2D_Shape::BuildAlgo()
|
void ISession2D_Shape::BuildAlgo()
|
||||||
{
|
{
|
||||||
myAlgo = new HLRBRep_Algo();
|
myAlgo = new HLRBRep_Algo();
|
||||||
TopTools_ListIteratorOfListOfShape anIterator(myListOfShape);
|
NCollection_List<TopoDS_Shape>::Iterator anIterator(myListOfShape);
|
||||||
for (;anIterator.More();anIterator.Next()) myAlgo->Add(anIterator.Value(),myNbIsos);
|
for (;anIterator.More();anIterator.Next()) myAlgo->Add(anIterator.Value(),myNbIsos);
|
||||||
myAlgo->Projector(myProjector);
|
myAlgo->Projector(myProjector);
|
||||||
myAlgo->Update();
|
myAlgo->Update();
|
||||||
@ -58,7 +75,7 @@ void ISession2D_Shape::BuildAlgo()
|
|||||||
void ISession2D_Shape::BuildPolyAlgo()
|
void ISession2D_Shape::BuildPolyAlgo()
|
||||||
{
|
{
|
||||||
myPolyAlgo = new HLRBRep_PolyAlgo();
|
myPolyAlgo = new HLRBRep_PolyAlgo();
|
||||||
TopTools_ListIteratorOfListOfShape anIterator(myListOfShape);
|
NCollection_List<TopoDS_Shape>::Iterator anIterator(myListOfShape);
|
||||||
for (;anIterator.More();anIterator.Next()) myPolyAlgo->Load(anIterator.Value());
|
for (;anIterator.More();anIterator.Next()) myPolyAlgo->Load(anIterator.Value());
|
||||||
myPolyAlgo->Projector(myProjector);
|
myPolyAlgo->Projector(myProjector);
|
||||||
myPolyAlgo->Update();
|
myPolyAlgo->Update();
|
||||||
|
@ -1,33 +1,38 @@
|
|||||||
#ifndef _ISession2D_Shape_HeaderFile
|
#ifndef _ISession2D_Shape_HeaderFile
|
||||||
#define _ISession2D_Shape_HeaderFile
|
#define _ISession2D_Shape_HeaderFile
|
||||||
|
|
||||||
|
#include "AIS_InteractiveObject.hxx"
|
||||||
|
#include "Graphic3d_ArrayOfPolylines.hxx"
|
||||||
|
#include <HLRAlgo_Projector.hxx>
|
||||||
|
#include <HLRBRep_Algo.hxx>
|
||||||
|
#include <HLRBRep_PolyAlgo.hxx>
|
||||||
|
#include <NCollection_List.hxx>
|
||||||
|
#include "SelectMgr_SelectableObject.hxx"
|
||||||
#include <Standard_Macro.hxx>
|
#include <Standard_Macro.hxx>
|
||||||
#include <Standard_DefineHandle.hxx>
|
#include <Standard_DefineHandle.hxx>
|
||||||
#include "TopoDS_Shape.hxx"
|
#include "TopoDS_Shape.hxx"
|
||||||
|
|
||||||
#include "SelectMgr_SelectableObject.hxx"
|
|
||||||
#include "Graphic3d_ArrayOfPolylines.hxx"
|
|
||||||
#include "AIS_InteractiveObject.hxx"
|
|
||||||
|
|
||||||
#include <HLRAlgo_Projector.hxx>
|
|
||||||
#include <HLRBRep_Algo.hxx>
|
|
||||||
#include <HLRBRep_PolyAlgo.hxx>
|
|
||||||
|
|
||||||
DEFINE_STANDARD_HANDLE(ISession2D_Shape,AIS_InteractiveObject)
|
DEFINE_STANDARD_HANDLE(ISession2D_Shape,AIS_InteractiveObject)
|
||||||
class ISession2D_Shape : public AIS_InteractiveObject {
|
|
||||||
|
|
||||||
|
class ISession2D_Shape : public AIS_InteractiveObject
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
Standard_EXPORT ISession2D_Shape ();
|
Standard_EXPORT ISession2D_Shape ();
|
||||||
|
|
||||||
|
// Adds shape to the list of topological shapes
|
||||||
void Standard_EXPORT Add (const TopoDS_Shape& aShape);
|
void Standard_EXPORT Add (const TopoDS_Shape& aShape);
|
||||||
|
|
||||||
HLRAlgo_Projector& Projector() { return myProjector; }
|
// Removes shape from the list of shapes.
|
||||||
|
// It is used in case of shapes erasing.
|
||||||
|
void Standard_EXPORT Remove (const TopoDS_Shape& theShape);
|
||||||
|
// Returns myProjector
|
||||||
|
HLRAlgo_Projector& Projector() { return myProjector;};
|
||||||
|
|
||||||
Standard_EXPORT void SetProjector (HLRAlgo_Projector& aProjector);
|
Standard_EXPORT void SetProjector (HLRAlgo_Projector& aProjector);
|
||||||
|
|
||||||
private:
|
|
||||||
Standard_Integer myNbIsos;
|
|
||||||
|
|
||||||
public :
|
|
||||||
Standard_Integer& NbIsos() { return myNbIsos;};
|
Standard_Integer& NbIsos() { return myNbIsos;};
|
||||||
|
|
||||||
Standard_EXPORT void SetNbIsos (Standard_Integer& aNbIsos);
|
Standard_EXPORT void SetNbIsos (Standard_Integer& aNbIsos);
|
||||||
|
|
||||||
Standard_Boolean AcceptShapeDecomposition() {return Standard_True;}
|
Standard_Boolean AcceptShapeDecomposition() {return Standard_True;}
|
||||||
@ -35,6 +40,7 @@ Standard_Boolean AcceptShapeDecomposition() {return Standard_True;}
|
|||||||
virtual Standard_Boolean AcceptSelectionMode (const Standard_Integer /*aMode*/) const
|
virtual Standard_Boolean AcceptSelectionMode (const Standard_Integer /*aMode*/) const
|
||||||
{ return Standard_True; }
|
{ return Standard_True; }
|
||||||
|
|
||||||
|
public:
|
||||||
DEFINE_STANDARD_RTTI(ISession2D_Shape)
|
DEFINE_STANDARD_RTTI(ISession2D_Shape)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -45,21 +51,21 @@ void DrawCompound(const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
const TopoDS_Shape& theCompound,
|
const TopoDS_Shape& theCompound,
|
||||||
const Handle(Prs3d_LineAspect) theAspect);
|
const Handle(Prs3d_LineAspect) theAspect);
|
||||||
|
|
||||||
|
|
||||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
|
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
|
||||||
const Handle(Prs3d_Presentation)& thePresentation,
|
const Handle(Prs3d_Presentation)& thePresentation,
|
||||||
const Standard_Integer theMode = 0);
|
const Standard_Integer theMode = 0);
|
||||||
|
|
||||||
virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
|
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
|
||||||
|
const Standard_Integer aMode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TopTools_ListOfShape myListOfShape;
|
|
||||||
|
Standard_Integer myNbIsos;
|
||||||
|
NCollection_List<TopoDS_Shape> myListOfShape;
|
||||||
HLRAlgo_Projector myProjector;
|
HLRAlgo_Projector myProjector;
|
||||||
Handle(HLRBRep_Algo) myAlgo;
|
Handle(HLRBRep_Algo) myAlgo;
|
||||||
Handle(HLRBRep_PolyAlgo) myPolyAlgo;
|
Handle(HLRBRep_PolyAlgo) myPolyAlgo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// other inCurve functions and methods (like "C++: function call" methods)
|
// other inCurve functions and methods (like "C++: function call" methods)
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -280,14 +280,19 @@ void OCC_3dBaseDoc::OnUpdateObjectColor(CCmdUI* pCmdUI)
|
|||||||
void OCC_3dBaseDoc::OnObjectErase()
|
void OCC_3dBaseDoc::OnObjectErase()
|
||||||
{
|
{
|
||||||
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
||||||
|
{
|
||||||
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
myAISContext->Erase (myAISContext->Current(), Standard_True);
|
||||||
|
}
|
||||||
myAISContext->ClearCurrents();
|
myAISContext->ClearCurrents();
|
||||||
}
|
}
|
||||||
void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI)
|
void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI)
|
||||||
{
|
{
|
||||||
bool OneOrMoreIsDisplayed = false;
|
bool OneOrMoreIsDisplayed = false;
|
||||||
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
|
||||||
if (myAISContext->IsDisplayed(myAISContext->Current())) OneOrMoreIsDisplayed=true;
|
{
|
||||||
|
if (myAISContext->IsDisplayed (myAISContext->Current()))
|
||||||
|
OneOrMoreIsDisplayed = true;
|
||||||
|
}
|
||||||
pCmdUI->Enable (OneOrMoreIsDisplayed);
|
pCmdUI->Enable (OneOrMoreIsDisplayed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,16 +129,13 @@ BOOL CAboutDlgStd::OnInitDialog(){
|
|||||||
|
|
||||||
Title->SetWindowText(strTitle);
|
Title->SetWindowText(strTitle);
|
||||||
SetWindowText(dlgTitle);
|
SetWindowText(dlgTitle);
|
||||||
if(SampleName.Find("Viewer2d")==-1)
|
|
||||||
{
|
|
||||||
CWnd* aReadmeEdit = GetDlgItem(IDC_README);
|
CWnd* aReadmeEdit = GetDlgItem(IDC_README);
|
||||||
aReadmeEdit->ShowWindow(FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CFile aFile;
|
CFile aFile;
|
||||||
if(aFile.Open("..//..//..//README.txt",CFile::modeRead))
|
CString aHelpFilePath = CString (((OCC_App*)AfxGetApp())->GetInitDataDir()) + "\\README.txt";
|
||||||
|
if(aFile.Open (aHelpFilePath, CFile::modeRead))
|
||||||
{
|
{
|
||||||
|
aReadmeEdit->ShowWindow(TRUE);
|
||||||
UINT aFileLength = (UINT)aFile.GetLength();
|
UINT aFileLength = (UINT)aFile.GetLength();
|
||||||
char* buffer=new char[aFileLength];
|
char* buffer=new char[aFileLength];
|
||||||
aFile.Read(buffer,aFileLength);
|
aFile.Read(buffer,aFileLength);
|
||||||
@ -147,6 +144,9 @@ BOOL CAboutDlgStd::OnInitDialog(){
|
|||||||
ReadmeText.Replace("\n","\r\n");
|
ReadmeText.Replace("\n","\r\n");
|
||||||
UpdateData(FALSE);
|
UpdateData(FALSE);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aReadmeEdit->ShowWindow(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
CenterWindow();
|
CenterWindow();
|
||||||
|
Binary file not shown.
@ -129,7 +129,7 @@ BEGIN
|
|||||||
DEFPUSHBUTTON "OK",IDOK,101,233,88,14,WS_GROUP
|
DEFPUSHBUTTON "OK",IDOK,101,233,88,14,WS_GROUP
|
||||||
CTEXT "http://www.opencascade.com",IDC_STATIC,92,116,98,8,SS_CENTERIMAGE
|
CTEXT "http://www.opencascade.com",IDC_STATIC,92,116,98,8,SS_CENTERIMAGE
|
||||||
CONTROL 1300,IDC_STATIC,"Static",SS_BITMAP,73,28,132,64,WS_EX_CLIENTEDGE
|
CONTROL 1300,IDC_STATIC,"Static",SS_BITMAP,73,28,132,64,WS_EX_CLIENTEDGE
|
||||||
EDITTEXT IDC_README,7,131,270,94,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL,WS_EX_LEFTSCROLLBAR
|
EDITTEXT IDC_README,7,131,270,94,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_ResultDialog DIALOG 0, 0, 212, 202
|
IDD_ResultDialog DIALOG 0, 0, 212, 202
|
||||||
|
Loading…
x
Reference in New Issue
Block a user