1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0023791: Remove obsolete functionality - animation mode and degeneration presentation mode

This commit is contained in:
kgv 2013-03-15 11:46:21 +04:00
parent 123e4db005
commit de75ed09ad
71 changed files with 497 additions and 3106 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?> <?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9,00" Version="9.00"
Name="OCC" Name="OCC"
ProjectGUID="{DCB139CF-2190-412E-B72F-8B080CC01422}" ProjectGUID="{DCB139CF-2190-412E-B72F-8B080CC01422}"
Keyword="Win32Proj" Keyword="Win32Proj"
@ -63,7 +63,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="TKV3d.lib TKV2d.lib TKHLR.lib TKService.lib TKBool.lib TKPShape.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKG2d.lib TKG3d.lib PTKernel.lib TKShapeSchema.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib" AdditionalDependencies="TKV3d.lib TKHLR.lib TKService.lib TKBool.lib TKPShape.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKG2d.lib TKG3d.lib PTKernel.lib TKShapeSchema.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib"
OutputFile="$(OutDir)/OCC.dll" OutputFile="$(OutDir)/OCC.dll"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)" AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
@ -144,7 +144,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="TKV3d.lib TKV2d.lib TKHLR.lib TKService.lib TKBool.lib TKPShape.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKG2d.lib TKG3d.lib PTKernel.lib TKShapeSchema.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib" AdditionalDependencies="TKV3d.lib TKHLR.lib TKService.lib TKBool.lib TKPShape.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKG2d.lib TKG3d.lib PTKernel.lib TKShapeSchema.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib"
OutputFile="$(OutDir)/OCC.dll" OutputFile="$(OutDir)/OCC.dll"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="$(CSF_OPT_LIB32)" AdditionalLibraryDirectories="$(CSF_OPT_LIB32)"

View File

@ -78,13 +78,13 @@ void OCCViewer::RedrawView(void)
void OCCViewer::SetDegenerateModeOn(void) void OCCViewer::SetDegenerateModeOn(void)
{ {
if (!myView.IsNull()) if (!myView.IsNull())
myView->SetDegenerateModeOn(); myView->SetComputedMode (Standard_False);
} }
void OCCViewer::SetDegenerateModeOff(void) void OCCViewer::SetDegenerateModeOff(void)
{ {
if (!myView.IsNull()) if (!myView.IsNull())
myView->SetDegenerateModeOff(); myView->SetComputedMode (Standard_True);
} }
void OCCViewer::WindowFitAll(int Xmin, int Ymin, int Xmax, int Ymax) void OCCViewer::WindowFitAll(int Xmin, int Ymin, int Xmax, int Ymax)

View File

@ -51,6 +51,7 @@
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
#include <Geom_Axis2Placement.hxx> #include <Geom_Axis2Placement.hxx>
//csfdb I/E //csfdb I/E
#include <Message_ProgressIndicator.hxx>
#include <FSD_File.hxx> #include <FSD_File.hxx>
#include <ShapeSchema.hxx> #include <ShapeSchema.hxx>
#include <Storage_Data.hxx> #include <Storage_Data.hxx>
@ -71,4 +72,4 @@
//for stl export //for stl export
#include <StlAPI_Writer.hxx> #include <StlAPI_Writer.hxx>
//for vrml export //for vrml export
#include <VrmlAPI_Writer.hxx> #include <VrmlAPI_Writer.hxx>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?> <?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9,00" Version="9.00"
Name="shell" Name="shell"
ProjectGUID="{969912D9-78E7-4AB8-B4FF-6B52B4F03991}" ProjectGUID="{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
Keyword="Win32Proj" Keyword="Win32Proj"
@ -63,7 +63,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="OCC.lib TKV3d.lib TKV2d.lib TKHLR.lib TKService.lib PTKernel.lib TKShapeSchema.lib TKBool.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKPShape.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib" AdditionalDependencies="OCC.lib TKV3d.lib TKHLR.lib TKService.lib PTKernel.lib TKShapeSchema.lib TKBool.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKPShape.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib"
OutputFile="$(OutDir)/shell.dll" OutputFile="$(OutDir)/shell.dll"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\OCC\$(OutDir);$(CSF_OPT_LIB32D)" AdditionalLibraryDirectories="..\OCC\$(OutDir);$(CSF_OPT_LIB32D)"
@ -143,7 +143,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="OCC.lib TKV3d.lib TKV2d.lib TKHLR.lib TKService.lib PTKernel.lib TKShapeSchema.lib TKBool.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKPShape.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib" AdditionalDependencies="OCC.lib TKV3d.lib TKHLR.lib TKService.lib PTKernel.lib TKShapeSchema.lib TKBool.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKPShape.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib"
OutputFile="$(OutDir)/shell.dll" OutputFile="$(OutDir)/shell.dll"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\OCC\$(OutDir);$(CSF_OPT_LIB32)" AdditionalLibraryDirectories="..\OCC\$(OutDir);$(CSF_OPT_LIB32)"

View File

@ -139,9 +139,11 @@ void CGeometryView::OnLButtonDown(UINT nFlags, CPoint point)
break; break;
case CurAction3d_DynamicRotation : case CurAction3d_DynamicRotation :
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->StartRotation(point.x,point.y); myView->SetComputedMode (Standard_False);
}
myView->StartRotation (point.x, point.y);
break; break;
default : default :
Standard_Failure::Raise(" incompatible Current Mode "); Standard_Failure::Raise(" incompatible Current Mode ");
@ -231,31 +233,25 @@ void CGeometryView::OnMButtonUp(UINT nFlags, CPoint point)
void CGeometryView::OnRButtonDown(UINT nFlags, CPoint point) void CGeometryView::OnRButtonDown(UINT nFlags, CPoint point)
{ {
if ( nFlags & MK_CONTROL ) if ( nFlags & MK_CONTROL )
{ {
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->StartRotation(point.x,point.y); myView->SetComputedMode (Standard_False);
}
myView->StartRotation (point.x, point.y);
} }
else // if ( Ctrl ) else // if ( Ctrl )
{ {
Popup(point.x,point.y); Popup (point.x, point.y);
} }
} }
void CGeometryView::OnRButtonUp(UINT nFlags, CPoint point) void CGeometryView::OnRButtonUp(UINT nFlags, CPoint point)
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
if (!myDegenerateModeIsOn) myView->SetComputedMode (myHlrModeIsOn);
{
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
} else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
@ -341,16 +337,16 @@ void CGeometryView::OnMouseMove(UINT nFlags, CPoint point)
} }
} }
void CGeometryView::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI) void CGeometryView::OnUpdateBUTTONHlrOff (CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (myDegenerateModeIsOn); pCmdUI->SetCheck (!myHlrModeIsOn);
pCmdUI->Enable (!myDegenerateModeIsOn); pCmdUI->Enable (myHlrModeIsOn);
} }
void CGeometryView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI) void CGeometryView::OnUpdateBUTTONHlrOn (CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (!myDegenerateModeIsOn); pCmdUI->SetCheck (myHlrModeIsOn);
pCmdUI->Enable (myDegenerateModeIsOn); pCmdUI->Enable (!myHlrModeIsOn);
} }
void CGeometryView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI) void CGeometryView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)

View File

@ -101,38 +101,32 @@ END_MESSAGE_MAP()
// CViewer3dView construction/destruction // CViewer3dView construction/destruction
CViewer3dView::CViewer3dView() CViewer3dView::CViewer3dView()
: scaleX (1),
scaleY (1),
scaleZ (1),
myVisMode (VIS_SHADE),
myCurrentMode (CurAction3d_Nothing),
myXmin (0),
myYmin (0),
myXmax (0),
myYmax (0),
myCurZoom (0.0),
myWidth (0),
myHeight (0),
NbActiveLights (2), // There are 2 default active lights
myHlrModeIsOn (Standard_False),
m_Pen (NULL),
myAxisKey (0),
myScaleDirection (0)
{ {
// TODO: add construction code here // TODO: add construction code here
myXmin=0; myGraphicDriver = ((CViewer3dApp*)AfxGetApp())->GetGraphicDriver();
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
myWidth=0;
myHeight=0;
scaleX = 1;
scaleY = 1;
scaleZ = 1;
myAxisKey = 0;
myScaleDirection = 0;
myVisMode = VIS_SHADE;
// will be set in OnInitial update, but, for more security :
myCurrentMode = CurAction3d_Nothing;
myDegenerateModeIsOn=Standard_True;
m_Pen = NULL;
NbActiveLights=2; // There are 2 default active lights
myGraphicDriver = ((CViewer3dApp*)AfxGetApp())->GetGraphicDriver();
} }
CViewer3dView::~CViewer3dView() CViewer3dView::~CViewer3dView()
{ {
myView->Remove(); myView->Remove();
if (m_Pen) delete m_Pen; if (m_Pen) delete m_Pen;
} }
BOOL CViewer3dView::PreCreateWindow(CREATESTRUCT& cs) BOOL CViewer3dView::PreCreateWindow(CREATESTRUCT& cs)
@ -147,31 +141,29 @@ BOOL CViewer3dView::PreCreateWindow(CREATESTRUCT& cs)
// CViewer3dView drawing // CViewer3dView drawing
void CViewer3dView::OnInitialUpdate() void CViewer3dView::OnInitialUpdate()
{ {
CView::OnInitialUpdate(); CView::OnInitialUpdate();
myView = GetDocument()->GetViewer()->CreateView();
// set the default mode in wireframe ( not hidden line ! ) myView = GetDocument()->GetViewer()->CreateView();
myView->SetDegenerateModeOn();
// store for restore state after rotation (witch is in Degenerated mode)
myDegenerateModeIsOn = Standard_True;
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ()); // store for restore state after rotation (witch is in Degenerated mode)
myView->SetWindow(aWNTWindow); myHlrModeIsOn = Standard_False;
if (!aWNTWindow->IsMapped()) aWNTWindow->Map(); myView->SetComputedMode (myHlrModeIsOn);
// Standard_Integer w=100 , h=100 ; /* Debug Matrox */ Handle(WNT_Window) aWNTWindow = new WNT_Window (GetSafeHwnd());
// aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */ myView->SetWindow(aWNTWindow);
/* Resize is not supposed to be done on */ if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
/* Matrox */
/* I suspect another problem elsewhere */
// ::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
// store the mode ( nothing , dynamic zooming, dynamic ... ) // Standard_Integer w=100 , h=100 ; /* Debug Matrox */
myCurrentMode = CurAction3d_Nothing; // aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */
myVisMode = VIS_SHADE; /* Resize is not supposed to be done on */
RedrawVisMode(); /* Matrox */
/* I suspect another problem elsewhere */
// ::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
// store the mode ( nothing , dynamic zooming, dynamic ... )
myCurrentMode = CurAction3d_Nothing;
myVisMode = VIS_SHADE;
RedrawVisMode();
} }
void CViewer3dView::OnDraw(CDC* pDC) void CViewer3dView::OnDraw(CDC* pDC)
@ -325,30 +317,28 @@ GetDocument()->UpdateResultMessageDlg("SetProj",Message);
void CViewer3dView::OnBUTTONHlrOff() void CViewer3dView::OnBUTTONHlrOff()
{ {
myView->SetDegenerateModeOn(); myHlrModeIsOn = Standard_False;
myDegenerateModeIsOn = Standard_True; myView->SetComputedMode (myHlrModeIsOn);
TCollection_AsciiString Message("\ TCollection_AsciiString aMsg ("myView->SetComputedMode (Standard_False);\n"
myView->SetDegenerateModeOn();\n\ " ");
");
// Update The Result Message Dialog // Update The Result Message Dialog
GetDocument()->UpdateResultMessageDlg("SetDegenerateModeOn",Message); GetDocument()->UpdateResultMessageDlg ("SetComputedMode", aMsg);
} }
void CViewer3dView::OnBUTTONHlrOn() void CViewer3dView::OnBUTTONHlrOn()
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetDegenerateModeOff(); myHlrModeIsOn = Standard_True;
myDegenerateModeIsOn = Standard_False; myView->SetComputedMode (myHlrModeIsOn);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
TCollection_AsciiString Message("\ TCollection_AsciiString aMsg ("myView->SetComputedMode (Standard_True);\n"
myView->SetDegenerateModeOff();\n\ " ");
");
// Update The Result Message Dialog // Update The Result Message Dialog
GetDocument()->UpdateResultMessageDlg("SetDegenerateModeOff",Message); GetDocument()->UpdateResultMessageDlg ("SetComputedMode", aMsg);
} }
void CViewer3dView::OnBUTTONPan() void CViewer3dView::OnBUTTONPan()
@ -414,10 +404,12 @@ void CViewer3dView::OnLButtonDown(UINT nFlags, CPoint point)
case CurAction3d_GlobalPanning :// noting case CurAction3d_GlobalPanning :// noting
break; break;
case CurAction3d_DynamicRotation : case CurAction3d_DynamicRotation :
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->StartRotation(point.x,point.y); myView->SetComputedMode (Standard_False);
break; }
myView->StartRotation (point.x, point.y);
break;
case CurAction3d_BeginPositionalLight : case CurAction3d_BeginPositionalLight :
{ {
p1 = ConvertClickToPoint(point.x,point.y,myView); p1 = ConvertClickToPoint(point.x,point.y,myView);
@ -573,7 +565,7 @@ void CViewer3dView::OnLButtonUp(UINT nFlags, CPoint point)
} }
break; break;
case CurAction3d_DynamicZooming : case CurAction3d_DynamicZooming :
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
myCurrentMode = CurAction3d_Nothing; myCurrentMode = CurAction3d_Nothing;
break; break;
case CurAction3d_WindowZooming : case CurAction3d_WindowZooming :
@ -607,7 +599,7 @@ void CViewer3dView::OnMButtonDown(UINT nFlags, CPoint point)
if ( nFlags & MK_CONTROL ) if ( nFlags & MK_CONTROL )
{ {
// Button MB2 down Control : panning init // Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
} }
} }
@ -616,38 +608,32 @@ void CViewer3dView::OnMButtonUp(UINT nFlags, CPoint point)
if ( nFlags & MK_CONTROL ) if ( nFlags & MK_CONTROL )
{ {
// Button MB2 down Control : panning init // Button MB2 down Control : panning init
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
} }
} }
void CViewer3dView::OnRButtonDown(UINT nFlags, CPoint point) void CViewer3dView::OnRButtonDown(UINT nFlags, CPoint point)
{ {
if ( nFlags & MK_CONTROL ) if ( nFlags & MK_CONTROL )
{ {
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->StartRotation(point.x,point.y); myView->SetComputedMode (Standard_False);
} }
else // if ( Ctrl ) myView->StartRotation (point.x, point.y);
{ }
GetDocument()->Popup(point.x,point.y,myView); else // if ( Ctrl )
} {
GetDocument()->Popup (point.x, point.y, myView);
}
} }
void CViewer3dView::OnRButtonUp(UINT nFlags, CPoint point) void CViewer3dView::OnRButtonUp(UINT nFlags, CPoint point)
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
if (!myDegenerateModeIsOn) myView->SetComputedMode (myHlrModeIsOn);
{ SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
} else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
void CViewer3dView::OnMouseMove(UINT nFlags, CPoint point) void CViewer3dView::OnMouseMove(UINT nFlags, CPoint point)
@ -779,16 +765,16 @@ void CViewer3dView::OnMouseMove(UINT nFlags, CPoint point)
} }
} }
void CViewer3dView::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI) void CViewer3dView::OnUpdateBUTTONHlrOff (CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (myDegenerateModeIsOn); pCmdUI->SetCheck (!myHlrModeIsOn);
pCmdUI->Enable (!myDegenerateModeIsOn); pCmdUI->Enable (myHlrModeIsOn);
} }
void CViewer3dView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI) void CViewer3dView::OnUpdateBUTTONHlrOn (CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (!myDegenerateModeIsOn); pCmdUI->SetCheck (myHlrModeIsOn);
pCmdUI->Enable (myDegenerateModeIsOn); pCmdUI->Enable (!myHlrModeIsOn);
} }
void CViewer3dView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI) void CViewer3dView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)

View File

@ -67,9 +67,9 @@ public:
virtual void Dump(CDumpContext& dc) const; virtual void Dump(CDumpContext& dc) const;
#endif #endif
int scaleX; int scaleX;
int scaleY; int scaleY;
int scaleZ; int scaleZ;
protected: protected:
@ -125,28 +125,27 @@ protected:
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
private: private:
enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR }; enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
VisMode myVisMode; VisMode myVisMode;
Handle_V3d_View myView; Handle_V3d_View myView;
Handle_Graphic3d_GraphicDriver myGraphicDriver; Handle_Graphic3d_GraphicDriver myGraphicDriver;
View3D_CurrentAction myCurrentMode; View3D_CurrentAction myCurrentMode;
Standard_Integer myXmin; Standard_Integer myXmin;
Standard_Integer myYmin; Standard_Integer myYmin;
Standard_Integer myXmax; Standard_Integer myXmax;
Standard_Integer myYmax; Standard_Integer myYmax;
Standard_Integer myWidth; Standard_Integer myWidth;
Standard_Integer myHeight; Standard_Integer myHeight;
Standard_Integer NbActiveLights;
Standard_Integer NbActiveLights; Standard_Boolean myHlrModeIsOn;
Quantity_Factor myCurZoom; Quantity_Factor myCurZoom;
Standard_Boolean myDegenerateModeIsOn; Handle_V3d_AmbientLight myCurrent_AmbientLight;
Handle_V3d_AmbientLight myCurrent_AmbientLight; Handle_V3d_SpotLight myCurrent_SpotLight;
Handle_V3d_SpotLight myCurrent_SpotLight; Handle_V3d_PositionalLight myCurrent_PositionalLight;
Handle_V3d_PositionalLight myCurrent_PositionalLight; Handle_V3d_DirectionalLight myCurrent_DirectionalLight;
Handle_V3d_DirectionalLight myCurrent_DirectionalLight; Handle_V3d_Plane myPlane;
Handle_V3d_Plane myPlane; Handle_AIS_Shape myShape;
Handle_AIS_Shape myShape;
private: private:
enum LineStyle { Solid, Dot, ShortDash, LongDash, Default }; enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };

View File

@ -274,7 +274,7 @@ BEGIN
CONTROL "AXOVIEW",IDC_AxoView,"Button",BS_OWNERDRAW | WS_TABSTOP,201,40,13,14 CONTROL "AXOVIEW",IDC_AxoView,"Button",BS_OWNERDRAW | WS_TABSTOP,201,40,13,14
DEFPUSHBUTTON "Get Shapes",ID_GetShape,105,22,57,14 DEFPUSHBUTTON "Get Shapes",ID_GetShape,105,22,57,14
PUSHBUTTON "Update 2D",ID_Update2D,165,22,50,14 PUSHBUTTON "Update 2D",ID_Update2D,165,22,50,14
CONTROL "Degenerated Mode",IDC_DegeneratedMode,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,143,77,10 CONTROL "HLR Mode",IDC_HlrModeIsOn,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,143,51,10
PUSHBUTTON "Close",IDOK,150,160,50,14 PUSHBUTTON "Close",IDOK,150,160,50,14
EDITTEXT IDC_EDIT_NBIsos,100,167,30,12,ES_AUTOHSCROLL EDITTEXT IDC_EDIT_NBIsos,100,167,30,12,ES_AUTOHSCROLL
GROUPBOX "Hidden",IDC_STATIC,10,89,82,65 GROUPBOX "Hidden",IDC_STATIC,10,89,82,65

View File

@ -1,5 +1,5 @@
//{{NO_DEPENDENCIES}} //{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file. // Microsoft Visual C++ generated include file.
// Used by HLR.rc // Used by HLR.rc
// //
#define ID_MENU_CASCADE_PROPERTIES 150 #define ID_MENU_CASCADE_PROPERTIES 150
@ -102,7 +102,7 @@
#define IDC_STATIC_NbIsos 1520 #define IDC_STATIC_NbIsos 1520
#define IDC_DrawHiddenLine 1521 #define IDC_DrawHiddenLine 1521
#define ID_Update2D 1522 #define ID_Update2D 1522
#define IDC_DegeneratedMode 1523 #define IDC_HlrModeIsOn 1523
#define IDC_TopView 1529 #define IDC_TopView 1529
#define IDC_DUMMYBUTTON 1530 #define IDC_DUMMYBUTTON 1530
#define IDC_BottomView 1531 #define IDC_BottomView 1531
@ -112,6 +112,7 @@
#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 32795
// Next default values for new objects // Next default values for new objects
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED

View File

@ -32,7 +32,7 @@ CSelectionDialog::CSelectionDialog(CHLRDoc* aDoc,CWnd* pParent /*=NULL*/)
m_DisplayMode = 0; m_DisplayMode = 0;
m_NbIsos = 2; m_NbIsos = 2;
m_DrawHiddenLine = TRUE; m_DrawHiddenLine = TRUE;
m_DegeneratedModeOn = TRUE; m_HlrModeIsOn = FALSE;
//}}AFX_DATA_INIT //}}AFX_DATA_INIT
} }
@ -44,7 +44,7 @@ void CSelectionDialog::DoDataExchange(CDataExchange* pDX)
DDX_Radio(pDX, IDC_DisplayDefault, m_DisplayMode); DDX_Radio(pDX, IDC_DisplayDefault, m_DisplayMode);
DDX_Text(pDX, IDC_EDIT_NBIsos, m_NbIsos); DDX_Text(pDX, IDC_EDIT_NBIsos, m_NbIsos);
DDX_Check(pDX, IDC_DrawHiddenLine, m_DrawHiddenLine); DDX_Check(pDX, IDC_DrawHiddenLine, m_DrawHiddenLine);
DDX_Check(pDX, IDC_DegeneratedMode, m_DegeneratedModeOn); DDX_Check(pDX, IDC_HlrModeIsOn, m_HlrModeIsOn);
//}}AFX_DATA_MAP //}}AFX_DATA_MAP
} }
@ -80,7 +80,7 @@ BEGIN_MESSAGE_MAP(CSelectionDialog, CDialog)
ON_WM_RBUTTONUP() ON_WM_RBUTTONUP()
ON_WM_MOUSEMOVE() ON_WM_MOUSEMOVE()
ON_BN_CLICKED(IDC_DrawHiddenLine, OnDrawHiddenLine) ON_BN_CLICKED(IDC_DrawHiddenLine, OnDrawHiddenLine)
ON_BN_CLICKED(IDC_DegeneratedMode, OnDegeneratedMode) ON_BN_CLICKED(IDC_HlrModeIsOn, OnHlrMode)
ON_WM_DRAWITEM() ON_WM_DRAWITEM()
ON_WM_PAINT() ON_WM_PAINT()
//}}AFX_MSG_MAP //}}AFX_MSG_MAP
@ -121,30 +121,30 @@ BOOL CSelectionDialog::OnInitDialog()
void CSelectionDialog::OnDisplay(bool isFit) void CSelectionDialog::OnDisplay(bool isFit)
{ {
GetDlgItem(IDC_DUMMYBUTTON)->SetRedraw(true); GetDlgItem(IDC_DUMMYBUTTON)->SetRedraw(true);
if(!myDisplay) { if (!myDisplay)
Handle(Graphic3d_GraphicDriver) aGraphicDriver = {
((CHLRApp*)AfxGetApp())->GetGraphicDriver(); Handle(Graphic3d_GraphicDriver) aGraphicDriver = ((CHLRApp*)AfxGetApp())->GetGraphicDriver();
myActiveViewer = new V3d_Viewer(aGraphicDriver,(short *) "Visu3D"); myActiveViewer = new V3d_Viewer(aGraphicDriver,(short *) "Visu3D");
myActiveViewer->SetDefaultLights(); myActiveViewer->SetDefaultLights();
myActiveViewer->SetLightOn(); myActiveViewer->SetLightOn();
myActiveView = myActiveViewer->CreateView(); myActiveView = myActiveViewer->CreateView();
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetDlgItem(IDC_DUMMYBUTTON)->GetSafeHwnd(), Handle(WNT_Window) aWNTWindow = new WNT_Window (GetDlgItem(IDC_DUMMYBUTTON)->GetSafeHwnd(),
Quantity_NOC_GRAY); Quantity_NOC_GRAY);
myActiveView->SetComputedMode (m_HlrModeIsOn);
myActiveView->SetWindow(aWNTWindow);
if (m_DegeneratedModeOn) myActiveView->SetDegenerateModeOn(); myInteractiveContext = new AIS_InteractiveContext(myActiveViewer);
myActiveView->SetWindow(aWNTWindow);
myInteractiveContext = new AIS_InteractiveContext(myActiveViewer); // TRIHEDRON
Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
myTrihedron=new AIS_Trihedron(aTrihedronAxis);
// TRIHEDRON myInteractiveContext->Display(myTrihedron);
Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
myTrihedron=new AIS_Trihedron(aTrihedronAxis);
myInteractiveContext->Display(myTrihedron);
} }
if(isFit) { if (isFit)
{
myActiveView->ZFitAll(); myActiveView->ZFitAll();
myActiveView->FitAll(); myActiveView->FitAll();
} }
@ -389,20 +389,18 @@ void CSelectionDialog::OnAxoView()
OnDisplay(true); OnDisplay(true);
} }
void CSelectionDialog::OnDegeneratedMode() void CSelectionDialog::OnHlrMode()
{ {
UpdateData(true); UpdateData(true);
if(m_DegeneratedModeOn) if (!m_HlrModeIsOn)
{ {
myActiveView->SetDegenerateModeOn(); myActiveView->SetComputedMode (m_HlrModeIsOn);
m_DegeneratedModeOn = Standard_True;
} }
else else
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myActiveView->SetDegenerateModeOff(); myActiveView->SetComputedMode (m_HlrModeIsOn);
m_DegeneratedModeOn = Standard_False;
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
OnDisplay(false); OnDisplay(false);
@ -433,16 +431,20 @@ void CSelectionDialog::OnRButtonDown(UINT nFlags, CPoint point)
{ {
CDialog::OnRButtonDown(nFlags, point); CDialog::OnRButtonDown(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) || if ((myPosMinX > point.x) || (myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y)) (myPosMinY > point.y) || (myPosMaxY < point.y))
return;
if ( nFlags & CASCADESHORTCUTKEY )
{ {
if (!m_DegeneratedModeOn) return;
myActiveView->SetDegenerateModeOn(); }
myActiveView->StartRotation(point.x,point.y);
OnDisplay(false); if ( nFlags & CASCADESHORTCUTKEY )
{
if (m_HlrModeIsOn)
{
myActiveView->SetComputedMode (Standard_False);
}
myActiveView->StartRotation (point.x, point.y);
OnDisplay (false);
} }
} }
@ -450,17 +452,16 @@ void CSelectionDialog::OnRButtonUp(UINT nFlags, CPoint point)
{ {
CDialog::OnRButtonUp(nFlags, point); CDialog::OnRButtonUp(nFlags, point);
if ((myPosMinX > point.x)||(myPosMaxX < point.x) || if ((myPosMinX > point.x) || (myPosMaxX < point.x) ||
(myPosMinY > point.y) ||(myPosMaxY < point.y)) (myPosMinY > point.y) || (myPosMaxY < point.y))
{
return; return;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
// reset tyhe good Degenerated mode according to the strored one // reset tyhe good HLR mode according to the strored one
// --> dynamic rotation may have change it // --> dynamic rotation may have change it
if (!m_DegeneratedModeOn) myActiveView->SetComputedMode (m_HlrModeIsOn);
myActiveView->SetDegenerateModeOff();
else
myActiveView->SetDegenerateModeOn();
OnDisplay(false); OnDisplay(false);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }

View File

@ -29,7 +29,7 @@ public:
int m_DisplayMode; int m_DisplayMode;
int m_NbIsos; int m_NbIsos;
BOOL m_DrawHiddenLine; BOOL m_DrawHiddenLine;
BOOL m_DegeneratedModeOn; BOOL m_HlrModeIsOn;
//}}AFX_DATA //}}AFX_DATA
// Overrides // Overrides
@ -75,7 +75,7 @@ protected:
afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnDrawHiddenLine(); afx_msg void OnDrawHiddenLine();
afx_msg void OnDegeneratedMode(); afx_msg void OnHlrMode();
afx_msg void OnPaint(); afx_msg void OnPaint();
//}}AFX_MSG //}}AFX_MSG
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()

View File

@ -83,28 +83,18 @@ END_MESSAGE_MAP()
// CAnimationView3D construction/destruction // CAnimationView3D construction/destruction
CAnimationView3D::CAnimationView3D() CAnimationView3D::CAnimationView3D()
: myXmin (0),
myYmin (0),
myXmax (0),
myYmax (0),
myCurZoom (0.0),
myHlrModeIsOn (Standard_False),
myCurrentMode (CurrentAction3d_Nothing),
m_FlySens (500.0),
m_TurnSens (M_PI / 40.0),
m_Pen (NULL)
{ {
// TODO: add construction code here // TODO: add construction code here
myXmin=0;
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
// will be set in OnInitial update, but, for more security :
myCurrentMode = CurrentAction3d_Nothing;
myDegenerateModeIsOn=Standard_True;
m_Pen = NULL;
myXmin=0;
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
// will be set in OnInitial update, but, for more security :
m_FlySens = 500. ;
m_TurnSens = M_PI / 40. ;
} }
CAnimationView3D::~CAnimationView3D() CAnimationView3D::~CAnimationView3D()
@ -136,61 +126,60 @@ void CAnimationView3D::OnDraw(CDC* pDC)
} }
void CAnimationView3D::OnInitialUpdate() void CAnimationView3D::OnInitialUpdate()
{ {
CView::OnInitialUpdate(); CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class // TODO: Add your specialized code here and/or call the base class
// TODO: Add your specialized code here and/or call the base class // myView = GetDocument()->GetViewer()->CreateView();
// myView = GetDocument()->GetViewer()->CreateView();
Handle(V3d_Viewer) aViewer ; Handle(V3d_Viewer) aViewer;
aViewer = GetDocument()->GetViewer() ;
aViewer->DefaultPerspectiveView () ;
aViewer->SetDefaultTypeOfView ( V3d_PERSPECTIVE ) ;
myView = aViewer->CreateView();
// store for restore state after rotation (witch is in Degenerated mode) aViewer = GetDocument()->GetViewer();
myDegenerateModeIsOn = myView->DegenerateModeIsOn(); aViewer->DefaultPerspectiveView();
aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
myView = aViewer->CreateView();
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ()); // store for restore state after rotation (witch is in Degenerated mode)
myView->SetWindow(aWNTWindow); myHlrModeIsOn = myView->ComputedMode();
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
// store the mode ( nothing , dynamic zooming, dynamic ... ) Handle(WNT_Window) aWNTWindow = new WNT_Window (GetSafeHwnd());
myCurrentMode = CurrentAction3d_Nothing; myView->SetWindow(aWNTWindow);
CFrameWnd* pParentFrm = GetParentFrame(); if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
pParentFrm->ActivateFrame(SW_SHOWMAXIMIZED);
Standard_Integer w=100 , h=100 ; /* Debug Matrox */ // store the mode ( nothing , dynamic zooming, dynamic ... )
aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */ myCurrentMode = CurrentAction3d_Nothing;
/* Resize is not supposed to be done on */ CFrameWnd* pParentFrm = GetParentFrame();
/* Matrox */ pParentFrm->ActivateFrame(SW_SHOWMAXIMIZED);
/* I suspect another problem elsewhere */
::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
myPView = Handle(V3d_PerspectiveView)::DownCast (myView); 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 ) ;
m_Tune.Create ( IDD_TUNE , NULL ) ; myPView = Handle(V3d_PerspectiveView)::DownCast (myView);
RECT dlgrect;
m_Tune.GetWindowRect(&dlgrect);
LONG width = dlgrect.right-dlgrect.left;
LONG height = dlgrect.bottom-dlgrect.top;
RECT MainWndRect;
AfxGetApp()->m_pMainWnd->GetWindowRect(&MainWndRect);
LONG left = MainWndRect.left+3;
LONG top = MainWndRect.top + 112;
m_Tune.MoveWindow(left,top,width,height);
m_Tune.m_pView = this ;
m_Tune.ShowWindow ( SW_HIDE ); m_Tune.Create ( IDD_TUNE , NULL ) ;
// store the mode ( nothing , dynamic zooming, dynamic ... ) RECT dlgrect;
m_Tune.GetWindowRect(&dlgrect);
LONG width = dlgrect.right-dlgrect.left;
LONG height = dlgrect.bottom-dlgrect.top;
RECT MainWndRect;
AfxGetApp()->m_pMainWnd->GetWindowRect(&MainWndRect);
LONG left = MainWndRect.left+3;
LONG top = MainWndRect.top + 112;
m_Tune.MoveWindow(left,top,width,height);
myCurrentMode = CurrentAction3d_Nothing; m_Tune.m_pView = this ;
ReloadData () ; m_Tune.ShowWindow ( SW_HIDE );
// store the mode ( nothing , dynamic zooming, dynamic ... )
myCurrentMode = CurrentAction3d_Nothing;
ReloadData () ;
} }
@ -285,15 +274,15 @@ void CAnimationView3D::OnBUTTONAxo()
void CAnimationView3D::OnBUTTONHlrOff() void CAnimationView3D::OnBUTTONHlrOff()
{ {
myView->SetDegenerateModeOn(); myHlrModeIsOn = Standard_False;
myDegenerateModeIsOn = Standard_True; myView->SetComputedMode (myHlrModeIsOn);
} }
void CAnimationView3D::OnBUTTONHlrOn() void CAnimationView3D::OnBUTTONHlrOn()
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetDegenerateModeOff(); myHlrModeIsOn = Standard_True;
myDegenerateModeIsOn = Standard_False; myView->SetComputedMode (myHlrModeIsOn);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
@ -373,9 +362,11 @@ void CAnimationView3D::OnLButtonDown(UINT nFlags, CPoint point)
case CurrentAction3d_GlobalPanning :// noting case CurrentAction3d_GlobalPanning :// noting
break; break;
case CurrentAction3d_DynamicRotation : case CurrentAction3d_DynamicRotation :
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->StartRotation(point.x,point.y); myView->SetComputedMode (Standard_False);
}
myView->StartRotation (point.x, point.y);
break; break;
case CurrentAction3d_Fly : case CurrentAction3d_Fly :
KillTimer (1) ; KillTimer (1) ;
@ -479,31 +470,25 @@ void CAnimationView3D::OnMButtonUp(UINT nFlags, CPoint point)
void CAnimationView3D::OnRButtonDown(UINT nFlags, CPoint point) void CAnimationView3D::OnRButtonDown(UINT nFlags, CPoint point)
{ {
if ( nFlags & MK_CONTROL ) if ( nFlags & MK_CONTROL )
{ {
// SetCursor(AfxGetApp()->LoadStandardCursor()); // SetCursor(AfxGetApp()->LoadStandardCursor());
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->StartRotation(point.x,point.y); myView->SetComputedMode (Standard_False);
} }
else // if ( Ctrl ) myView->StartRotation (point.x, point.y);
{ }
GetDocument()->Popup(point.x,point.y,myView); else // if ( Ctrl )
} {
GetDocument()->Popup(point.x,point.y,myView);
}
} }
void CAnimationView3D::OnRButtonUp(UINT nFlags, CPoint point) void CAnimationView3D::OnRButtonUp(UINT nFlags, CPoint point)
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
if (!myDegenerateModeIsOn) myView->SetComputedMode (myHlrModeIsOn);
{
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
} else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
@ -598,14 +583,14 @@ void CAnimationView3D::OnMouseMove(UINT nFlags, CPoint point)
void CAnimationView3D::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI) void CAnimationView3D::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (myDegenerateModeIsOn); pCmdUI->SetCheck (!myHlrModeIsOn);
pCmdUI->Enable (!myDegenerateModeIsOn); pCmdUI->Enable (myHlrModeIsOn);
} }
void CAnimationView3D::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI) void CAnimationView3D::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (!myDegenerateModeIsOn); pCmdUI->SetCheck (myHlrModeIsOn);
pCmdUI->Enable (myDegenerateModeIsOn); pCmdUI->Enable (!myHlrModeIsOn);
} }
void CAnimationView3D::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI) void CAnimationView3D::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)

View File

@ -131,22 +131,21 @@ public:
Handle_V3d_View& GetView() { return myView;}; Handle_V3d_View& GetView() { return myView;};
void DisplayTuneDialog(); void DisplayTuneDialog();
private: private:
// CurrentAction3d myCurrentMode; Standard_Integer myXmin;
Standard_Integer myXmin; Standard_Integer myYmin;
Standard_Integer myYmin; Standard_Integer myXmax;
Standard_Integer myXmax; Standard_Integer myYmax;
Standard_Integer myYmax; Quantity_Factor myCurZoom;
Quantity_Factor myCurZoom; Standard_Boolean myHlrModeIsOn;
Standard_Boolean myDegenerateModeIsOn;
Handle_V3d_PerspectiveView myPView; Handle_V3d_PerspectiveView myPView;
View3D_CurrentAction myCurrentMode; View3D_CurrentAction myCurrentMode;
double m_Atx , m_Aty , m_Atz ; double m_Atx , m_Aty , m_Atz ;
double m_Eyex , m_Eyey , m_Eyez ; double m_Eyex , m_Eyey , m_Eyez ;
double m_FlySens ; double m_FlySens ;
double m_TurnSens ; double m_TurnSens ;
double m_Focus ; double m_Focus ;
private: private:
enum LineStyle { Solid, Dot, ShortDash, LongDash, Default }; enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };

View File

@ -57,19 +57,18 @@ END_MESSAGE_MAP()
// OCC_3dView construction/destruction // OCC_3dView construction/destruction
OCC_3dView::OCC_3dView() OCC_3dView::OCC_3dView()
: myCurrentMode (CurAction3d_Nothing),
myXmin (0),
myYmin (0),
myXmax (0),
myYmax (0),
myCurZoom (0.0),
myWidth (0),
myHeight (0),
myHlrModeIsOn (Standard_False),
m_Pen (NULL)
{ {
// TODO: add construction code here // TODO: add construction code here
myXmin=0;
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
myWidth=0;
myHeight=0;
// will be set in OnInitial update, but, for more security :
myCurrentMode = CurAction3d_Nothing;
myDegenerateModeIsOn=Standard_True;
m_Pen = NULL;
} }
OCC_3dView::~OCC_3dView() OCC_3dView::~OCC_3dView()
@ -94,11 +93,9 @@ void OCC_3dView::OnInitialUpdate()
myView = GetDocument()->GetViewer()->CreateView(); myView = GetDocument()->GetViewer()->CreateView();
// set the default mode in wireframe ( not hidden line ! )
myView->SetDegenerateModeOn();
// store for restore state after rotation (which is in Degenerated mode) // store for restore state after rotation (which is in Degenerated mode)
myDegenerateModeIsOn = Standard_True; myHlrModeIsOn = Standard_False;
myView->SetComputedMode (myHlrModeIsOn);
Handle(Graphic3d_GraphicDriver) aGraphicDriver = Handle(Graphic3d_GraphicDriver) aGraphicDriver =
((OCC_App*)AfxGetApp())->GetGraphicDriver(); ((OCC_App*)AfxGetApp())->GetGraphicDriver();
@ -229,15 +226,15 @@ void OCC_3dView::OnBUTTONAxo()
void OCC_3dView::OnBUTTONHlrOff() void OCC_3dView::OnBUTTONHlrOff()
{ {
myView->SetDegenerateModeOn(); myHlrModeIsOn = Standard_False;
myDegenerateModeIsOn = Standard_True; myView->SetComputedMode (myHlrModeIsOn);
} }
void OCC_3dView::OnBUTTONHlrOn() void OCC_3dView::OnBUTTONHlrOn()
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetDegenerateModeOff(); myHlrModeIsOn = Standard_True;
myDegenerateModeIsOn = Standard_False; myView->SetComputedMode (myHlrModeIsOn);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
@ -309,8 +306,11 @@ void OCC_3dView::OnLButtonDown(UINT nFlags, CPoint point)
case CurAction3d_GlobalPanning :// noting case CurAction3d_GlobalPanning :// noting
break; break;
case CurAction3d_DynamicRotation : case CurAction3d_DynamicRotation :
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->SetComputedMode (Standard_False);
}
myView->StartRotation(point.x,point.y); myView->StartRotation(point.x,point.y);
break; break;
default : default :
@ -373,16 +373,14 @@ void OCC_3dView::OnLButtonUp(UINT nFlags, CPoint point)
break; break;
case CurAction3d_DynamicRotation : case CurAction3d_DynamicRotation :
myCurrentMode = CurAction3d_Nothing; myCurrentMode = CurAction3d_Nothing;
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
{ {
CWaitCursor aWaitCursor; CWaitCursor aWaitCursor;
myView->SetDegenerateModeOff(); myView->SetComputedMode (myHlrModeIsOn);
myDegenerateModeIsOn = Standard_False;
} }
else else
{ {
myView->SetDegenerateModeOn(); myView->SetComputedMode (myHlrModeIsOn);
myDegenerateModeIsOn = Standard_True;
} }
break; break;
default : default :
@ -412,10 +410,12 @@ void OCC_3dView::OnMButtonUp(UINT nFlags, CPoint point)
void OCC_3dView::OnRButtonDown(UINT nFlags, CPoint point) void OCC_3dView::OnRButtonDown(UINT nFlags, CPoint point)
{ {
if ( nFlags & MK_CONTROL ) if ( nFlags & MK_CONTROL )
{ {
if (!myDegenerateModeIsOn) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->SetComputedMode (Standard_False);
}
myView->StartRotation(point.x,point.y); myView->StartRotation(point.x,point.y);
} }
else // if ( Ctrl ) else // if ( Ctrl )
@ -427,15 +427,7 @@ void OCC_3dView::OnRButtonDown(UINT nFlags, CPoint point)
void OCC_3dView::OnRButtonUp(UINT nFlags, CPoint point) void OCC_3dView::OnRButtonUp(UINT nFlags, CPoint point)
{ {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
if (!myDegenerateModeIsOn) myView->SetComputedMode (myHlrModeIsOn);
{
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
} else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
} }
@ -574,14 +566,14 @@ void OCC_3dView::DrawRectangle(const Standard_Integer MinX ,
void OCC_3dView::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI) void OCC_3dView::OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (myDegenerateModeIsOn); pCmdUI->SetCheck (!myHlrModeIsOn);
pCmdUI->Enable (!myDegenerateModeIsOn); pCmdUI->Enable (myHlrModeIsOn);
} }
void OCC_3dView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI) void OCC_3dView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
{ {
pCmdUI->SetCheck (!myDegenerateModeIsOn); pCmdUI->SetCheck (myHlrModeIsOn);
pCmdUI->Enable (myDegenerateModeIsOn); pCmdUI->Enable (!myHlrModeIsOn);
} }
void OCC_3dView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI) void OCC_3dView::OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI)

View File

@ -39,7 +39,7 @@ public:
// Overrides // Overrides
// ClassWizard generated virtual function overrides // ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(OCC_3dView) //{{AFX_VIRTUAL(OCC_3dView)
public: public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate(); virtual void OnInitialUpdate();
@ -90,16 +90,17 @@ protected:
#endif #endif
protected: protected:
Handle_V3d_View myView;
CurAction3d myCurrentMode; Handle_V3d_View myView;
Standard_Integer myXmin; CurAction3d myCurrentMode;
Standard_Integer myYmin; Standard_Integer myXmin;
Standard_Integer myXmax; Standard_Integer myYmin;
Standard_Integer myYmax; Standard_Integer myXmax;
Quantity_Factor myCurZoom; Standard_Integer myYmax;
Standard_Boolean myDegenerateModeIsOn; Quantity_Factor myCurZoom;
Standard_Integer myWidth; Standard_Integer myWidth;
Standard_Integer myHeight; Standard_Integer myHeight;
Standard_Boolean myHlrModeIsOn;
enum LineStyle { Solid, Dot, ShortDash, LongDash, Default }; enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };
CPen* m_Pen; CPen* m_Pen;

View File

@ -60,7 +60,7 @@ DocumentCommon* MDIWindow::getDocument()
return myDocument; return myDocument;
} }
void MDIWindow::closeEvent(QCloseEvent* e) void MDIWindow::closeEvent(QCloseEvent* )
{ {
emit sendCloseView(this); emit sendCloseView(this);
} }

View File

@ -144,7 +144,7 @@ myViewActions( 0 )
} }
#endif #endif
myCurrentMode = CurAction3d_Nothing; myCurrentMode = CurAction3d_Nothing;
myDegenerateModeIsOn = Standard_True; myHlrModeIsOn = Standard_False;
setMouseTracking( true ); setMouseTracking( true );
initViewActions(); initViewActions();
@ -186,7 +186,7 @@ void View::init()
myView->MustBeResized(); myView->MustBeResized();
} }
void View::paintEvent( QPaintEvent * e ) void View::paintEvent( QPaintEvent * )
{ {
// QApplication::syncX(); // QApplication::syncX();
if( myFirst ) if( myFirst )
@ -197,7 +197,7 @@ void View::paintEvent( QPaintEvent * e )
myView->Redraw(); myView->Redraw();
} }
void View::resizeEvent( QResizeEvent * e) void View::resizeEvent( QResizeEvent * )
{ {
// QApplication::syncX(); // QApplication::syncX();
if( !myView.IsNull() ) if( !myView.IsNull() )
@ -286,16 +286,16 @@ void View::reset()
void View::hlrOff() void View::hlrOff()
{ {
QApplication::setOverrideCursor( Qt::WaitCursor ); QApplication::setOverrideCursor( Qt::WaitCursor );
myView->SetDegenerateModeOn(); myHlrModeIsOn = Standard_False;
myDegenerateModeIsOn = Standard_True; myView->SetComputedMode (myHlrModeIsOn);
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
void View::hlrOn() void View::hlrOn()
{ {
QApplication::setOverrideCursor( Qt::WaitCursor ); QApplication::setOverrideCursor( Qt::WaitCursor );
myView->SetDegenerateModeOff(); myHlrModeIsOn = Standard_True;
myDegenerateModeIsOn = Standard_False; myView->SetComputedMode (myHlrModeIsOn);
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
@ -580,8 +580,10 @@ void View::onLButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint poi
case CurAction3d_GlobalPanning: case CurAction3d_GlobalPanning:
break; break;
case CurAction3d_DynamicRotation: case CurAction3d_DynamicRotation:
if ( !myDegenerateModeIsOn ) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->SetComputedMode (Standard_False);
}
myView->StartRotation( point.x(), point.y() ); myView->StartRotation( point.x(), point.y() );
break; break;
default: default:
@ -592,7 +594,7 @@ void View::onLButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint poi
activateCursor( myCurrentMode ); activateCursor( myCurrentMode );
} }
void View::onMButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint point ) void View::onMButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint /*point*/ )
{ {
if ( nFlags & CASCADESHORTCUTKEY ) if ( nFlags & CASCADESHORTCUTKEY )
myCurrentMode = CurAction3d_DynamicPanning; myCurrentMode = CurAction3d_DynamicPanning;
@ -603,8 +605,10 @@ void View::onRButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint poi
{ {
if ( nFlags & CASCADESHORTCUTKEY ) if ( nFlags & CASCADESHORTCUTKEY )
{ {
if ( !myDegenerateModeIsOn ) if (myHlrModeIsOn)
myView->SetDegenerateModeOn(); {
myView->SetComputedMode (Standard_False);
}
myCurrentMode = CurAction3d_DynamicRotation; myCurrentMode = CurAction3d_DynamicRotation;
myView->StartRotation( point.x(), point.y() ); myView->StartRotation( point.x(), point.y() );
} }
@ -676,13 +680,13 @@ void View::onLButtonUp( Qt::MouseButtons nFlags, const QPoint point )
ApplicationCommonWindow::getApplication()->onSelectionChanged(); ApplicationCommonWindow::getApplication()->onSelectionChanged();
} }
void View::onMButtonUp( Qt::MouseButtons nFlags, const QPoint point ) void View::onMButtonUp( Qt::MouseButtons /*nFlags*/, const QPoint /*point*/ )
{ {
myCurrentMode = CurAction3d_Nothing; myCurrentMode = CurAction3d_Nothing;
activateCursor( myCurrentMode ); activateCursor( myCurrentMode );
} }
void View::onRButtonUp( Qt::MouseButtons nFlags, const QPoint point ) void View::onRButtonUp( Qt::MouseButtons /*nFlags*/, const QPoint point )
{ {
if ( myCurrentMode == CurAction3d_Nothing ) if ( myCurrentMode == CurAction3d_Nothing )
Popup( point.x(), point.y() ); Popup( point.x(), point.y() );
@ -691,16 +695,7 @@ void View::onRButtonUp( Qt::MouseButtons nFlags, const QPoint point )
QApplication::setOverrideCursor( Qt::WaitCursor ); QApplication::setOverrideCursor( Qt::WaitCursor );
// reset tyhe good Degenerated mode according to the strored one // reset tyhe good Degenerated mode according to the strored one
// --> dynamic rotation may have change it // --> dynamic rotation may have change it
if ( !myDegenerateModeIsOn ) myView->SetComputedMode (myHlrModeIsOn);
{
myView->SetDegenerateModeOff();
myDegenerateModeIsOn = Standard_False;
}
else
{
myView->SetDegenerateModeOn();
myDegenerateModeIsOn = Standard_True;
}
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
myCurrentMode = CurAction3d_Nothing; myCurrentMode = CurAction3d_Nothing;
} }
@ -783,7 +778,7 @@ void View::DragEvent( const int x, const int y, const int TheState )
} }
} }
void View::InputEvent( const int x, const int y ) void View::InputEvent( const int /*x*/, const int /*y*/ )
{ {
myContext->Select(); myContext->Select();
emit selectionChanged(); emit selectionChanged();
@ -816,13 +811,13 @@ void View::MultiDragEvent( const int x, const int y, const int TheState )
} }
} }
void View::MultiInputEvent( const int x, const int y ) void View::MultiInputEvent( const int /*x*/, const int /*y*/ )
{ {
myContext->ShiftSelect(); myContext->ShiftSelect();
emit selectionChanged(); emit selectionChanged();
} }
void View::Popup( const int x, const int y ) void View::Popup( const int /*x*/, const int /*y*/ )
{ {
ApplicationCommonWindow* stApp = ApplicationCommonWindow::getApplication(); ApplicationCommonWindow* stApp = ApplicationCommonWindow::getApplication();
QWorkspace* ws = ApplicationCommonWindow::getWorkspace(); QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
@ -865,7 +860,7 @@ void View::Popup( const int x, const int y )
w->setFocus(); w->setFocus();
} }
void View::addItemInPopup( QMenu* theMenu) void View::addItemInPopup( QMenu* /*theMenu*/)
{ {
} }

View File

@ -117,7 +117,7 @@ private:
Standard_Integer myXmax; Standard_Integer myXmax;
Standard_Integer myYmax; Standard_Integer myYmax;
Quantity_Factor myCurZoom; Quantity_Factor myCurZoom;
Standard_Boolean myDegenerateModeIsOn; Standard_Boolean myHlrModeIsOn;
QList<QAction*>* myViewActions; QList<QAction*>* myViewActions;
QRubberBand* myRectBand; //!< selection rectangle rubber band QRubberBand* myRectBand; //!< selection rectangle rubber band
}; };

View File

@ -25,8 +25,6 @@
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible i -- GG : GER61351 17/11/1999 Change SetColor() with a compatible i
-- Quantity_Color instead the restricted NameOfColor. -- Quantity_Color instead the restricted NameOfColor.
-- Add SetCurrentFacingModel() methods -- Add SetCurrentFacingModel() methods
-- EUG : G003 05/11/1999 Degeneration mode support
-- Add SetDegenerateModel() methods
-- GG : IMP140200 Add SetSelectedAspect() method -- GG : IMP140200 Add SetSelectedAspect() method
-- GG : 25/05/00 BUC60688 Add SetSensitivity() methods -- GG : 25/05/00 BUC60688 Add SetSensitivity() methods
-- VSV : 22/05/01 Add Selection by polygon -- VSV : 22/05/01 Add Selection by polygon
@ -143,7 +141,6 @@ uses
Location from TopLoc, Location from TopLoc,
EntityOwner from SelectMgr, EntityOwner from SelectMgr,
TypeOfFacingModel from Aspect, TypeOfFacingModel from Aspect,
TypeOfDegenerateModel from Aspect,
Array1OfPnt2d from TColgp, Array1OfPnt2d from TColgp,
Transformation from Geom Transformation from Geom
@ -702,33 +699,6 @@ is
-- Standard_False, the presentation of the Interactive -- Standard_False, the presentation of the Interactive
-- Object activates the selection mode; the object is -- Object activates the selection mode; the object is
-- displayed but no viewer will be updated. -- displayed but no viewer will be updated.
SetDegenerateModel ( me : mutable;
aniobj : InteractiveObject from AIS;
aModel : TypeOfDegenerateModel from Aspect =
Aspect_TDM_WIREFRAME;
aRatio : Ratio from Quantity = 0.0);
---Level: Public
---Purpose: Sets the model of degeneration for the shaded representation
-- of the object <aniobj>
-- according to the degenerate ratio >= 0. & <= 1. where :
-- <aRatio> = 0. indicate that all polygons of the object
-- will be displayed.
-- <aRatio> = 1. indicate that no polygons will be displayed !!
-- When <ARatio> is > 0 & < 1. the corresponding amount
-- of object polygons will be displayed with a random method.
-- Warning: the degenerate structure is shown only when
-- the animation and degenerate flags are set to TRUE
-- in V3d_View::SetAnimationMode(..)
---Category: Methods to manage the object degeneration
SetDegenerateModel (
me : mutable;
aModel : TypeOfDegenerateModel from Aspect;
aSkipRatio : Ratio from Quantity = 0.0
) is static;
---Purpose: Defines the degenerate method to apply on the shaded
-- representation of all objects.
SetLocalAttributes(me : mutable; SetLocalAttributes(me : mutable;
aniobj : InteractiveObject from AIS; aniobj : InteractiveObject from AIS;

View File

@ -23,12 +23,6 @@
#define BUC60577 //GG_101099 Enable to compute correctly #define BUC60577 //GG_101099 Enable to compute correctly
// transparency with more than one object in the view. // transparency with more than one object in the view.
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
#define G003 //EUG_26/01/00 Degenerate support (G003)
//IMP140200 //GG Add SetSelectedAspect() method.
#define BUC60632 //GG 15/03/00 Add protection on SetDisplayMode() #define BUC60632 //GG 15/03/00 Add protection on SetDisplayMode()
// method, compute only authorized presentation. // method, compute only authorized presentation.
@ -2495,45 +2489,6 @@ void AIS_InteractiveContext::UnsetTransparency(const Handle(AIS_InteractiveObjec
UpdateCurrentViewer(); UpdateCurrentViewer();
} }
//=======================================================================
//function : SetDegenerateModel
//purpose :
//=======================================================================
#ifdef G003
void AIS_InteractiveContext :: SetDegenerateModel (
const Handle( AIS_InteractiveObject )& anObject,
const Aspect_TypeOfDegenerateModel aModel,
const Quantity_Ratio aRatio
) {
if ( !anObject.IsNull () ) {
if ( !anObject -> HasInteractiveContext () )
anObject -> SetContext ( this );
anObject->SetDegenerateModel(aModel,aRatio);
} // end if
} // end AIS_InteractiveContext :: SetDegenerateModel
void AIS_InteractiveContext :: SetDegenerateModel (
const Aspect_TypeOfDegenerateModel aModel,
const Quantity_Ratio aRatio
) {
AIS_DataMapIteratorOfDataMapOfIOStatus it ( myObjects );
while ( it.More () ) {
Handle( AIS_InteractiveObject ) obj = it.Key ();
obj->SetDegenerateModel(aModel,aRatio);
it.Next ();
} // end while
} // end AIS_InteractiveContext :: SetDegenerateModel
#endif
//======================================================================= //=======================================================================
//function : SetSelectedAspect //function : SetSelectedAspect
//purpose : //purpose :

View File

@ -21,8 +21,6 @@
-- GG : GER61351 17/11/1999 Change SetColor() with a compatible -- GG : GER61351 17/11/1999 Change SetColor() with a compatible
-- Quantity_Color instead the restricted NameOfColor. -- Quantity_Color instead the restricted NameOfColor.
-- Add SetCurrentFacingModel() methods -- Add SetCurrentFacingModel() methods
-- EUG : G003 05/11/1999 Degeneration mode support
-- Add SetDegenerateModel() methods
-- GG : IMP140100 Add HasPresentation() and Presentation() methods -- GG : IMP140100 Add HasPresentation() and Presentation() methods
-- Add SetAspect() method -- Add SetAspect() method
-- SAN : OCC4895 22/03/04 High-level interface for controlling polygon offsets -- SAN : OCC4895 22/03/04 High-level interface for controlling polygon offsets
@ -73,7 +71,6 @@ uses
InteractiveContext from AIS, InteractiveContext from AIS,
KindOfInteractive from AIS, KindOfInteractive from AIS,
TypeOfFacingModel from Aspect, TypeOfFacingModel from Aspect,
TypeOfDegenerateModel from Aspect,
Transformation from Geom, Transformation from Geom,
Presentation from Prs3d, Presentation from Prs3d,
BasicAspect from Prs3d, BasicAspect from Prs3d,
@ -532,31 +529,6 @@ is
State(me) returns Integer from Standard ; State(me) returns Integer from Standard ;
---C++: inline ---C++: inline
SetDegenerateModel ( me : mutable;
aModel : TypeOfDegenerateModel from Aspect =
Aspect_TDM_WIREFRAME;
aRatio : Ratio from Quantity = 0.0) is virtual;
---Level: Public
---Purpose: Sets the model of degeneration for the shaded representation
-- according to the degenerate ratio >= 0. & <= 1. where :
-- <aRatio> = 0. indicate that all polygons of the object
-- will be displayed.
-- <aRatio> = 1. indicate that no polygons will be displayed !!
-- When <ARatio> is > 0 & < 1. the corresponding amount
-- of object polygons will be displayed with a random method.
-- Warning: the degenerate structure is shown only when
-- the animation and degenerate flags are set to TRUE
-- in V3d_View::SetAnimationMode(..)
-- Category: Methods to manage the object degeneration
DegenerateModel ( me ;
aRatio: out Ratio from Quantity )
returns TypeOfDegenerateModel from Aspect is virtual;
---Level: Public
---Purpose: returns the current degeneration model and ratio
-- for the polygons
---Category: Inquire methods
SetTransformation ( me : mutable; SetTransformation ( me : mutable;
aTranformation: Transformation from Geom; aTranformation: Transformation from Geom;
postConcatenate: Boolean from Standard = Standard_False; postConcatenate: Boolean from Standard = Standard_False;

View File

@ -28,9 +28,6 @@
// instead a restricted object NameOfColor. // instead a restricted object NameOfColor.
// Add SetCurrentFacingModel() method // Add SetCurrentFacingModel() method
#define G003 //EUG/GG 260100 DEgenerate mode support
// Add SetDegenerateModel() methods
#define IMP020200 //GG Add SetTransformation() method #define IMP020200 //GG Add SetTransformation() method
#define IMP140200 //GG Add HasPresentation() and Presentation() methods #define IMP140200 //GG Add HasPresentation() and Presentation() methods
@ -556,43 +553,6 @@ void AIS_InteractiveObject::SetInfiniteState(const Standard_Boolean aFlag)
P->SetInfiniteState(myInfiniteState);} P->SetInfiniteState(myInfiniteState);}
} }
#ifdef G003
//=======================================================================
//function : SetDegenerateModel
//purpose :
//=======================================================================
void AIS_InteractiveObject::SetDegenerateModel(
const Aspect_TypeOfDegenerateModel aModel,
const Quantity_Ratio aRatio ) {
if( !HasColor() && !IsTransparent() && !HasMaterial() ) {
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
}
myDrawer->ShadingAspect()->Aspect()->SetDegenerateModel(aModel,aRatio);
if(!GetContext().IsNull()){
if( GetContext()->MainPrsMgr()->HasPresentation(this,1)){
Handle(Prs3d_Presentation) P =
GetContext()->MainPrsMgr()->CastPresentation(this,1)->Presentation();
Handle(Graphic3d_AspectFillArea3d) a4bis =
myDrawer->ShadingAspect()->Aspect();
P->SetPrimitivesAspect(a4bis);
}
}
}
//=======================================================================
//function : DegenerateModel
//purpose :
//=======================================================================
Aspect_TypeOfDegenerateModel AIS_InteractiveObject::DegenerateModel(
Quantity_Ratio& aRatio) const
{
return myDrawer->ShadingAspect()->Aspect()->DegenerateModel(aRatio);
}
#endif
#ifdef IMP020200 #ifdef IMP020200
//======================================================================= //=======================================================================
//function : SetTransformation //function : SetTransformation

View File

@ -52,8 +52,6 @@
-- Add GDM_None in enum GridDrawMode. -- Add GDM_None in enum GridDrawMode.
-- Modified: 25-JAN-00 : VKH -- Modified: 25-JAN-00 : VKH
-- Add class PixMap -- Add class PixMap
-- Modified: 26-JAN-00 : EUG/GG G003
-- Add enum TypeOfDegenerateModel
-- Modified: 23-FEB-00 : GG -- Modified: 23-FEB-00 : GG
-- Returns format name in ValuesOfFOSP() internal method. -- Returns format name in ValuesOfFOSP() internal method.
-- Modified: 27-03-02 RIC120302 GG Add imported class -- Modified: 27-03-02 RIC120302 GG Add imported class
@ -791,18 +789,6 @@ is
TOFM_FRONT_SIDE TOFM_FRONT_SIDE
end TypeOfFacingModel; end TypeOfFacingModel;
enumeration TypeOfDegenerateModel is
TDM_NONE,
TDM_TINY,
TDM_WIREFRAME,
TDM_MARKER,
TDM_BBOX,
TDM_AUTO
end TypeOfDegenerateModel;
---Purpose: Defines type of degeneration model of the
-- graphic structure.
---Category: The enumerations
enumeration FillMethod is enumeration FillMethod is
FM_NONE, FM_NONE,
FM_CENTERED, FM_CENTERED,

View File

@ -23,10 +23,6 @@
-- 0312/99 ; GG : BUC60488 Why the field DistinguishModeActive -- 0312/99 ; GG : BUC60488 Why the field DistinguishModeActive
-- field is not accessible properly ? -- field is not accessible properly ?
-- workaround : Move the Material fields at end. -- workaround : Move the Material fields at end.
-- 26/01/00 ; EUG/GG degeneration management (G003)
-- Add SetDegenerateModel() and DegenerateModel() methods
-- 29/09/00 ; GG degeneration management (G003)
-- Add SetDefaultDegenerateModel() and DefaultDegenerateModel() methods
-- 22/03/04 ; OCC4895 SAN High-level interface for controlling polygon offsets -- 22/03/04 ; OCC4895 SAN High-level interface for controlling polygon offsets
class AspectFillArea3d from Graphic3d inherits AspectFillArea from Aspect class AspectFillArea3d from Graphic3d inherits AspectFillArea from Aspect
@ -51,7 +47,6 @@ uses
TypeOfLine from Aspect, TypeOfLine from Aspect,
InteriorStyle from Aspect, InteriorStyle from Aspect,
TypeOfDegenerateModel from Aspect,
MaterialAspect from Graphic3d, MaterialAspect from Graphic3d,
TextureMap from Graphic3d TextureMap from Graphic3d
@ -170,36 +165,6 @@ is
SetTextureMapOn(me : mutable); SetTextureMapOn(me : mutable);
SetTextureMapOff(me : mutable); SetTextureMapOff(me : mutable);
SetDefaultDegenerateModel ( myclass;
aModel : TypeOfDegenerateModel from Aspect =
Aspect_TDM_WIREFRAME;
aRatio : Ratio from Quantity = 0.0);
---Level: Public
---Purpose: Sets the default model of degeneration for the polygons
-- which is taking in account at creation time of any
-- graphic structure until the model is change using
-- SetDegenerateModel() method.
---Category: Methods to manage the structure degeneration
SetDegenerateModel ( me : mutable;
aModel : TypeOfDegenerateModel from Aspect =
Aspect_TDM_WIREFRAME;
aRatio : Ratio from Quantity = 0.0);
---Level: Public
---Purpose: Sets the model of degeneration for the polygons
-- according to the degenerate ratio >= 0. & <= 1. where :
-- <aRatio> = 0. indicate that all polygons of the graphic structure
-- are displayed.
-- <aRatio> = 1. indicate that nothing is displayed in the graphic
-- structure.
-- When <ARatio> is > 0 & < 1. the corresponding amount
-- of polygons are displayed in the graphic structure with a
-- random method.
-- Warning: the degenerate structure is shown only when
-- the animation and degenerate flags are set to TRUE
-- in V3d_View::SetAnimationMode(..)
---Category: Methods to manage the structure degeneration
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
SetPolygonOffsets ( me : mutable; SetPolygonOffsets ( me : mutable;
aMode : Integer from Standard; aMode : Integer from Standard;
@ -272,22 +237,6 @@ is
TextureMapState(me) TextureMapState(me)
returns Boolean from Standard; returns Boolean from Standard;
DegenerateModel ( me ;
aRatio: out Ratio from Quantity )
returns TypeOfDegenerateModel from Aspect;
---Level: Public
---Purpose: returns the current degeneration model and ratio
-- for the polygons
---Category: Inquire methods
DefaultDegenerateModel ( myclass ;
aRatio: out Ratio from Quantity )
returns TypeOfDegenerateModel from Aspect;
---Level: Public
---Purpose: returns the default degeneration model and ratio
-- for the polygons
---Category: Inquire methods
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
PolygonOffsets ( me; PolygonOffsets ( me;
aMode : out Integer from Standard; aMode : out Integer from Standard;
@ -298,7 +247,7 @@ is
---Category: Inquire methods ---Category: Inquire methods
-- --
fields fields
@ -335,10 +284,6 @@ fields
MyFrontMaterial : MaterialAspect from Graphic3d; MyFrontMaterial : MaterialAspect from Graphic3d;
MyBackMaterial : MaterialAspect from Graphic3d; MyBackMaterial : MaterialAspect from Graphic3d;
-- the degenate model
MyDegenerateModel : TypeOfDegenerateModel from Aspect;
MyDegenerateRatio : Ratio from Quantity;
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
-- polygon offsets -- polygon offsets
MyPolygonOffsetMode : Integer from Standard; MyPolygonOffsetMode : Integer from Standard;

View File

@ -17,17 +17,6 @@
// purpose or non-infringement. Please see the License for the specific terms // purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License. // and conditions governing the rights and limitations under the License.
// Modified 1/08/97 ; PCT : Ajout texture mapping
// 26/01/00 ; EUG/GG degeneration management (G003)
// Add SetDegenerateModel() and DegenerateModel() methods
// JR 02.01.100 : Initialization order of fields in contructors
// 29/09/00 ; GG Add SetDefaultDegerateModel() and
// DefaultDegenerateModel() class methods
// 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
//-Version
//-Design Declaration of variables specific to the context //-Design Declaration of variables specific to the context
// of tracing of facets 3D // of tracing of facets 3D
@ -39,57 +28,19 @@
// Additionally, it has more than one definition of material // Additionally, it has more than one definition of material
// for internal and external faces. // for internal and external faces.
//-References
//-Language C++ 2.0
//-Declarations
// for the class // for the class
#include <Graphic3d_AspectFillArea3d.ixx> #include <Graphic3d_AspectFillArea3d.ixx>
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
#include <Aspect_PolygonOffsetMode.hxx> #include <Aspect_PolygonOffsetMode.hxx>
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
//-Aliases
//-Global data definitions
static Aspect_TypeOfDegenerateModel theDefaultDegenerateModel = Aspect_TDM_WIREFRAME;
static Quantity_Ratio theDefaultDegenerateRatio = 0.0;
// -- la matiere
// MyFrontMaterial : MaterialAspect;
// MyBackMaterial : MaterialAspect;
// -- flag de distinction entre faces internes et externes
// DistinguishModeActive : Standard_Boolean;
// -- flag de trace des aretes
// EdgeModeActive : Standard_Boolean;
// -- flag d'affichage des polygones tournant le dos
// BackFaceRemovalActive : Standard_Boolean;
//-Constructors
//-Destructors
//-Methods, in order
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (): Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d ():
DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFaceRemovalActive (Standard_False), MyTextureMapState(Standard_False), MyFrontMaterial (), MyBackMaterial () { DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFaceRemovalActive (Standard_False), MyTextureMapState(Standard_False), MyFrontMaterial (), MyBackMaterial ()
MyDegenerateModel = theDefaultDegenerateModel; {
MyDegenerateRatio = theDefaultDegenerateRatio;
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
// By default, aspect do not change current polygon offset parameters // By default, aspect do not change current polygon offset parameters
MyPolygonOffsetMode = Aspect_POM_Fill; MyPolygonOffsetMode = Aspect_POM_Fill;
MyPolygonOffsetFactor = 1.; MyPolygonOffsetFactor = 1.;
MyPolygonOffsetUnits = 0.; MyPolygonOffsetUnits = 0.;
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
} }
// (InteriorStyle, InteriorColor, EdgeColor, EdgeLineType, EdgeLineWidth) // (InteriorStyle, InteriorColor, EdgeColor, EdgeLineType, EdgeLineWidth)
@ -99,15 +50,10 @@ DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFac
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle InteriorStyle, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeLineWidth, const Graphic3d_MaterialAspect& FrontMaterial, const Graphic3d_MaterialAspect& BackMaterial): Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d (const Aspect_InteriorStyle InteriorStyle, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeLineWidth, const Graphic3d_MaterialAspect& FrontMaterial, const Graphic3d_MaterialAspect& BackMaterial):
Aspect_AspectFillArea (InteriorStyle, InteriorColor, EdgeColor, EdgeLineType, EdgeLineWidth), DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFaceRemovalActive (Standard_False), MyTextureMap(), MyTextureMapState(Standard_False), MyFrontMaterial (FrontMaterial), MyBackMaterial (BackMaterial) { Aspect_AspectFillArea (InteriorStyle, InteriorColor, EdgeColor, EdgeLineType, EdgeLineWidth), DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFaceRemovalActive (Standard_False), MyTextureMap(), MyTextureMapState(Standard_False), MyFrontMaterial (FrontMaterial), MyBackMaterial (BackMaterial) {
MyDegenerateModel = theDefaultDegenerateModel;
MyDegenerateRatio = theDefaultDegenerateRatio;
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
// By default, aspect do not change current polygon offset parameters // By default, aspect do not change current polygon offset parameters
MyPolygonOffsetMode = Aspect_POM_Fill; MyPolygonOffsetMode = Aspect_POM_Fill;
MyPolygonOffsetFactor = 1.; MyPolygonOffsetFactor = 1.;
MyPolygonOffsetUnits = 0.; MyPolygonOffsetUnits = 0.;
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
} }
void Graphic3d_AspectFillArea3d::SetBackMaterial (const Graphic3d_MaterialAspect& AMaterial) { void Graphic3d_AspectFillArea3d::SetBackMaterial (const Graphic3d_MaterialAspect& AMaterial) {
@ -219,34 +165,6 @@ Standard_Boolean Graphic3d_AspectFillArea3d::TextureMapState() const
return MyTextureMapState; return MyTextureMapState;
} }
void Graphic3d_AspectFillArea3d::SetDefaultDegenerateModel(
const Aspect_TypeOfDegenerateModel aModel,
const Quantity_Ratio aRatio) {
theDefaultDegenerateModel = aModel;
theDefaultDegenerateRatio = aRatio;
}
void Graphic3d_AspectFillArea3d::SetDegenerateModel(
const Aspect_TypeOfDegenerateModel aModel,
const Quantity_Ratio aRatio) {
MyDegenerateModel = aModel;
MyDegenerateRatio = aRatio;
}
Aspect_TypeOfDegenerateModel Graphic3d_AspectFillArea3d::DefaultDegenerateModel(
Quantity_Ratio& aRatio) {
aRatio = theDefaultDegenerateRatio;
return theDefaultDegenerateModel;
}
Aspect_TypeOfDegenerateModel Graphic3d_AspectFillArea3d::DegenerateModel(
Quantity_Ratio& aRatio) const {
aRatio = MyDegenerateRatio;
return MyDegenerateModel;
}
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
void Graphic3d_AspectFillArea3d::SetPolygonOffsets(const Standard_Integer aMode, void Graphic3d_AspectFillArea3d::SetPolygonOffsets(const Standard_Integer aMode,
const Standard_ShortReal aFactor, const Standard_ShortReal aFactor,
const Standard_ShortReal aUnits) { const Standard_ShortReal aUnits) {
@ -262,4 +180,3 @@ void Graphic3d_AspectFillArea3d::PolygonOffsets(Standard_Integer& aMode,
aFactor = MyPolygonOffsetFactor; aFactor = MyPolygonOffsetFactor;
aUnits = MyPolygonOffsetUnits; aUnits = MyPolygonOffsetUnits;
} }
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets

View File

@ -39,8 +39,6 @@ public:
Distinguish (0), Distinguish (0),
BackFace (0), BackFace (0),
Edge (0), Edge (0),
DegenerationMode (0),
SkipRatio (0.0f),
PolygonOffsetMode (0), PolygonOffsetMode (0),
PolygonOffsetFactor (0.0f), PolygonOffsetFactor (0.0f),
PolygonOffsetUnits (0.0f) PolygonOffsetUnits (0.0f)
@ -76,9 +74,6 @@ public:
Graphic3d_CTexture Texture; Graphic3d_CTexture Texture;
int DegenerationMode;
float SkipRatio;
int PolygonOffsetMode; int PolygonOffsetMode;
float PolygonOffsetFactor; float PolygonOffsetFactor;
float PolygonOffsetUnits; float PolygonOffsetUnits;

View File

@ -93,8 +93,6 @@ public:
Active (0), Active (0),
ptrUnderLayer (NULL), ptrUnderLayer (NULL),
ptrOverLayer (NULL), ptrOverLayer (NULL),
IsDegenerates (0),
IsDegeneratesPrev (0),
Backfacing (0), Backfacing (0),
GDisplayCB (NULL), GDisplayCB (NULL),
GClientData (NULL), GClientData (NULL),
@ -127,8 +125,6 @@ public:
void* ptrUnderLayer; void* ptrUnderLayer;
void* ptrOverLayer; void* ptrOverLayer;
int IsDegenerates;
int IsDegeneratesPrev;
int Backfacing; int Backfacing;
Aspect_RenderingContext GContext; Aspect_RenderingContext GContext;

View File

@ -423,11 +423,6 @@ is
is deferred; is deferred;
---Purpose: call_togl_transformstructure ---Purpose: call_togl_transformstructure
DegenerateStructure ( me : mutable;
ACStructure : CStructure from Graphic3d )
is deferred;
---Purpose: call_togl_degeneratestructure
Transparency ( me : mutable; Transparency ( me : mutable;
ACView : CView from Graphic3d; ACView : CView from Graphic3d;
AFlag : Boolean from Standard ) AFlag : Boolean from Standard )
@ -618,20 +613,6 @@ is
---Purpose: call_togl_graduatedtrihedron_minmaxvalues ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
is deferred; is deferred;
---------------------------
-- Category: Animation mode
---------------------------
BeginAnimation ( me : mutable;
ACView : CView from Graphic3d)
is deferred;
---Purpose: call_togl_begin_animation
EndAnimation ( me : mutable;
ACView : CView from Graphic3d)
is deferred;
---Purpose: call_togl_end_animation
---------------------------------- ----------------------------------
-- Category: Ajout mode methods -- Category: Ajout mode methods
---------------------------------- ----------------------------------

View File

@ -53,8 +53,6 @@
// 30/11/98 ; FMN : S4069. Textes always visible. // 30/11/98 ; FMN : S4069. Textes always visible.
// 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets // 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
#define G003 //EUG 26/01/00 Degeneration management
#define BUC60918 //GG 31/05/01 A transparente structure priority must have the #define BUC60918 //GG 31/05/01 A transparente structure priority must have the
// MAX_PRIORITY value so, the highlighted structure must have // MAX_PRIORITY value so, the highlighted structure must have
// MAX_PRIORITY-1 value. // MAX_PRIORITY-1 value.
@ -984,13 +982,6 @@ Graphic3d_MATERIAL_PHYSIC : Graphic3d_MATERIAL_ASPECT;
{ {
CTXF->SetTextureMapOff(); CTXF->SetTextureMapOff();
} }
#ifdef G003
Aspect_TypeOfDegenerateModel dMode = Aspect_TypeOfDegenerateModel(
MyCStructure.ContextFillArea.DegenerationMode);
Quantity_Ratio dRatio =
MyCStructure.ContextFillArea.SkipRatio;
CTXF->SetDegenerateModel(dMode,dRatio);
#endif // G003
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
CTXF->SetPolygonOffsets(MyCStructure.ContextFillArea.PolygonOffsetMode, CTXF->SetPolygonOffsets(MyCStructure.ContextFillArea.PolygonOffsetMode,
@ -1081,12 +1072,6 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
MyCStructure.ContextFillArea.LineType = int (ALType); MyCStructure.ContextFillArea.LineType = int (ALType);
MyCStructure.ContextFillArea.Width = float (AWidth); MyCStructure.ContextFillArea.Width = float (AWidth);
MyCStructure.ContextFillArea.Hatch = int (CTX->HatchStyle ()); MyCStructure.ContextFillArea.Hatch = int (CTX->HatchStyle ());
#ifdef G003
Quantity_Ratio ratio;
MyCStructure.ContextFillArea.DegenerationMode =
int (CTX->DegenerateModel(ratio));
MyCStructure.ContextFillArea.SkipRatio = float (ratio);
#endif // G003
/*** Front and Back face ***/ /*** Front and Back face ***/
MyCStructure.ContextFillArea.Distinguish = CTX->Distinguish () ? 1:0; MyCStructure.ContextFillArea.Distinguish = CTX->Distinguish () ? 1:0;
@ -1239,9 +1224,6 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
MyGraphicDriver->ContextStructure (MyCStructure); MyGraphicDriver->ContextStructure (MyCStructure);
#ifdef G003
MyGraphicDriver -> DegenerateStructure (MyCStructure);
#endif
// CAL 14/04/95 // CAL 14/04/95
// Attributes are "IsSet" during the first update // Attributes are "IsSet" during the first update
@ -2142,13 +2124,6 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
MyCStructure.ContextFillArea.LineType = int (ALType); MyCStructure.ContextFillArea.LineType = int (ALType);
MyCStructure.ContextFillArea.Width = float (AWidth); MyCStructure.ContextFillArea.Width = float (AWidth);
MyCStructure.ContextFillArea.Hatch = int (CTXF->HatchStyle ()); MyCStructure.ContextFillArea.Hatch = int (CTXF->HatchStyle ());
#ifdef G003
Quantity_Ratio ratio;
MyCStructure.ContextFillArea.DegenerationMode =
int (CTXF->DegenerateModel(ratio));
MyCStructure.ContextFillArea.SkipRatio = float (ratio);
#endif // G003
/*** Front and Back face ***/ /*** Front and Back face ***/
MyCStructure.ContextFillArea.Distinguish = CTXF->Distinguish () ? 1:0; MyCStructure.ContextFillArea.Distinguish = CTXF->Distinguish () ? 1:0;

View File

@ -13,5 +13,4 @@ InterfaceGraphic_cPrintf.cxx
InterfaceGraphic_Palette.c InterfaceGraphic_Palette.c
InterfaceGraphic_PrimitiveArray.hxx InterfaceGraphic_PrimitiveArray.hxx
InterfaceGraphic_telem.hxx InterfaceGraphic_telem.hxx
InterfaceGraphic_degeneration.hxx
InterfaceGraphic_tgl_all.hxx InterfaceGraphic_tgl_all.hxx

View File

@ -16,10 +16,6 @@
// purpose or non-infringement. Please see the License for the specific terms // purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License. // and conditions governing the rights and limitations under the License.
/*
* 24/01/00 EUG : G003 add Structure_LABDegenerateModel value
*/
#ifndef LABELS_HXX_INCLUDED #ifndef LABELS_HXX_INCLUDED
#define LABELS_HXX_INCLUDED #define LABELS_HXX_INCLUDED
@ -56,9 +52,6 @@
/* structure, hierarchy */ /* structure, hierarchy */
#define Structure_LABConnect 33 #define Structure_LABConnect 33
/* structure degenerate model */
#define Structure_LABDegenerateModel 34
/* view, index */ /* view, index */
#define View_LABViewIndex 10 #define View_LABViewIndex 10

View File

@ -30,7 +30,6 @@ PARRAY and DARRAY primitives, used in OpenGl package for presentation
*/ */
#include <InterfaceGraphic_telem.hxx> #include <InterfaceGraphic_telem.hxx>
#include <InterfaceGraphic_degeneration.hxx>
#define MVERTICE 1 #define MVERTICE 1
#define MVNORMAL 2 #define MVNORMAL 2

View File

@ -1,54 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifndef __INTERFACEGRAPHIC_DEGENERATION_H
# define __INTERFACEGRAPHIC_DEGENERATION_H
/*
Created by EUG
16/06/2000 : ATS : G005 : Copied from OpenGl to InterfaceGraphic to support required
for InterfaceGraphic_Parray.hxx definitions
*/
#include <InterfaceGraphic_telem.hxx>
struct _degeneration
{
int mode;
float skipRatio;
DEFINE_STANDARD_ALLOC
};
typedef _degeneration DEGENERATION;
typedef _degeneration* PDEGENERATION;
struct _ds_internal
{
unsigned int list;
unsigned int dlist;
int degMode;
int model;
float skipRatio;
unsigned char* bDraw;
DEFINE_STANDARD_ALLOC
};
typedef _ds_internal DS_INTERNAL;
typedef _ds_internal* PDS_INTERNAL;
#endif /* __INTERFACEGRAPHIC_DEGENERATION_H */

View File

@ -43,7 +43,6 @@ OpenGl_PrimitiveArray.cxx
Handle_OpenGl_Workspace.hxx Handle_OpenGl_Workspace.hxx
OpenGl_Workspace.hxx OpenGl_Workspace.hxx
OpenGl_Workspace.cxx OpenGl_Workspace.cxx
OpenGl_Workspace_1.cxx
OpenGl_Workspace_2.cxx OpenGl_Workspace_2.cxx
OpenGl_Workspace_3.cxx OpenGl_Workspace_3.cxx
OpenGl_Workspace_5.cxx OpenGl_Workspace_5.cxx

View File

@ -94,19 +94,6 @@ Standard_ShortReal OpenGl_GraphicDriver::DefaultTextHeight() const
return 16.; return 16.;
} }
// =======================================================================
// function : InvalidateAllWorkspaces
// purpose : ex-TsmInitUpdateState, deprecated, need to decide what to do with EraseAnimation() call
// =======================================================================
void OpenGl_GraphicDriver::InvalidateAllWorkspaces()
{
for (NCollection_DataMap<Standard_Integer, Handle(OpenGl_Workspace)>::Iterator anIt (myMapOfWS);
anIt.More(); anIt.Next())
{
anIt.ChangeValue()->EraseAnimation();
}
}
// ======================================================================= // =======================================================================
// function : ToUseVBO // function : ToUseVBO
// purpose : // purpose :

View File

@ -157,7 +157,6 @@ public:
Standard_EXPORT void SetPlane (const Graphic3d_CView& ACView); Standard_EXPORT void SetPlane (const Graphic3d_CView& ACView);
Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView); Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView);
Standard_EXPORT void TransformStructure (const Graphic3d_CStructure& ACStructure); Standard_EXPORT void TransformStructure (const Graphic3d_CStructure& ACStructure);
Standard_EXPORT void DegenerateStructure (const Graphic3d_CStructure& ACStructure);
Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag); Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
Standard_EXPORT void Update (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer); Standard_EXPORT void Update (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer);
Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView); Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView);
@ -179,8 +178,6 @@ public:
Standard_EXPORT void GraduatedTrihedronDisplay (const Graphic3d_CView& view, const Graphic3d_CGraduatedTrihedron& cubic); Standard_EXPORT void GraduatedTrihedronDisplay (const Graphic3d_CView& view, const Graphic3d_CGraduatedTrihedron& cubic);
Standard_EXPORT void GraduatedTrihedronErase (const Graphic3d_CView& view); Standard_EXPORT void GraduatedTrihedronErase (const Graphic3d_CView& view);
Standard_EXPORT void GraduatedTrihedronMinMaxValues (const Standard_ShortReal xmin, const Standard_ShortReal ymin, const Standard_ShortReal zmin, const Standard_ShortReal xmax, const Standard_ShortReal ymax, const Standard_ShortReal zmax); Standard_EXPORT void GraduatedTrihedronMinMaxValues (const Standard_ShortReal xmin, const Standard_ShortReal ymin, const Standard_ShortReal zmin, const Standard_ShortReal xmax, const Standard_ShortReal ymax, const Standard_ShortReal zmax);
Standard_EXPORT void BeginAnimation (const Graphic3d_CView& ACView);
Standard_EXPORT void EndAnimation (const Graphic3d_CView& ACView);
Standard_EXPORT Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView, Standard_EXPORT Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView,
const Standard_Boolean theDrawToFrontBuffer); const Standard_Boolean theDrawToFrontBuffer);
Standard_EXPORT Standard_Boolean BeginAddMode (const Graphic3d_CView& ACView); Standard_EXPORT Standard_Boolean BeginAddMode (const Graphic3d_CView& ACView);
@ -326,9 +323,6 @@ private:
//! Could return NULL-handle if no window created by this driver. //! Could return NULL-handle if no window created by this driver.
Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const; Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
//! Deprecated.
void InvalidateAllWorkspaces();
public: public:
DEFINE_STANDARD_RTTI(OpenGl_GraphicDriver) DEFINE_STANDARD_RTTI(OpenGl_GraphicDriver)

View File

@ -57,31 +57,3 @@ void OpenGl_GraphicDriver::End ()
// So we disable this destructor here until openglDisplay not moved to OpenGl_GraphicDriver class definition. // So we disable this destructor here until openglDisplay not moved to OpenGl_GraphicDriver class definition.
///openglDisplay.Nullify(); ///openglDisplay.Nullify();
} }
//=======================================================================
//function : BeginAnimation
//purpose :
//=======================================================================
void OpenGl_GraphicDriver::BeginAnimation (const Graphic3d_CView& ACView)
{
const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
if (aCView)
{
const Standard_Boolean UpdateAM = (ACView.IsDegenerates && !ACView.IsDegeneratesPrev) || (!ACView.IsDegenerates && ACView.IsDegeneratesPrev);
aCView->WS->BeginAnimation(ACView.IsDegenerates != 0,UpdateAM);
((Graphic3d_CView*)(&ACView))->IsDegeneratesPrev = ACView.IsDegenerates; //szvgl: temporary
}
}
//=======================================================================
//function : EndAnimation
//purpose :
//=======================================================================
void OpenGl_GraphicDriver::EndAnimation (const Graphic3d_CView& ACView)
{
const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
if (aCView)
aCView->WS->EndAnimation();
}

View File

@ -31,7 +31,6 @@ void OpenGl_GraphicDriver::ClearGroup (const Graphic3d_CGroup& theCGroup)
return; return;
((OpenGl_Group* )theCGroup.ptrGroup)->Release (GetSharedContext()); ((OpenGl_Group* )theCGroup.ptrGroup)->Release (GetSharedContext());
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::FaceContextGroup (const Graphic3d_CGroup& theCGroup, void OpenGl_GraphicDriver::FaceContextGroup (const Graphic3d_CGroup& theCGroup,
@ -41,7 +40,6 @@ void OpenGl_GraphicDriver::FaceContextGroup (const Graphic3d_CGroup& theCGroup,
return; return;
((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectFace (GetSharedContext(), theCGroup.ContextFillArea, theNoInsert); ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectFace (GetSharedContext(), theCGroup.ContextFillArea, theNoInsert);
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::Group (Graphic3d_CGroup& theCGroup) void OpenGl_GraphicDriver::Group (Graphic3d_CGroup& theCGroup)
@ -50,7 +48,6 @@ void OpenGl_GraphicDriver::Group (Graphic3d_CGroup& theCGroup)
if (aStructure) if (aStructure)
{ {
theCGroup.ptrGroup = aStructure->AddGroup(); theCGroup.ptrGroup = aStructure->AddGroup();
InvalidateAllWorkspaces();
} }
} }
@ -60,7 +57,6 @@ void OpenGl_GraphicDriver::LineContextGroup (const Graphic3d_CGroup& theCGroup,
if (!theCGroup.ContextLine.IsDef || theCGroup.ptrGroup == NULL) return; if (!theCGroup.ContextLine.IsDef || theCGroup.ptrGroup == NULL) return;
((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectLine (theCGroup.ContextLine, theNoInsert); ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectLine (theCGroup.ContextLine, theNoInsert);
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup, void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
@ -69,7 +65,6 @@ void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup
if (!theCGroup.ContextMarker.IsDef || theCGroup.ptrGroup == NULL) return; if (!theCGroup.ContextMarker.IsDef || theCGroup.ptrGroup == NULL) return;
((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (theCGroup.ContextMarker, theNoInsert); ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (theCGroup.ContextMarker, theNoInsert);
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup, void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
@ -87,7 +82,6 @@ void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup
if (theCGroup.ptrGroup != NULL) if (theCGroup.ptrGroup != NULL)
{ {
((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (theCGroup.ContextMarker, theNoInsert); ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (theCGroup.ContextMarker, theNoInsert);
InvalidateAllWorkspaces();
} }
} }
@ -98,7 +92,6 @@ void OpenGl_GraphicDriver::RemoveGroup (const Graphic3d_CGroup& theCGroup)
return; return;
aStructure->RemoveGroup (GetSharedContext(), (const OpenGl_Group* )theCGroup.ptrGroup); aStructure->RemoveGroup (GetSharedContext(), (const OpenGl_Group* )theCGroup.ptrGroup);
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::TextContextGroup (const Graphic3d_CGroup& theCGroup, void OpenGl_GraphicDriver::TextContextGroup (const Graphic3d_CGroup& theCGroup,
@ -108,5 +101,4 @@ void OpenGl_GraphicDriver::TextContextGroup (const Graphic3d_CGroup& theCGroup,
return; return;
((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectText (theCGroup.ContextText, theNoInsert); ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectText (theCGroup.ContextText, theNoInsert);
InvalidateAllWorkspaces();
} }

View File

@ -31,7 +31,6 @@ void OpenGl_GraphicDriver::ClearStructure (const Graphic3d_CStructure& theCStruc
return; return;
aStructure->Clear (GetSharedContext()); aStructure->Clear (GetSharedContext());
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::ContextStructure (const Graphic3d_CStructure& theCStructure) void OpenGl_GraphicDriver::ContextStructure (const Graphic3d_CStructure& theCStructure)
@ -53,8 +52,6 @@ void OpenGl_GraphicDriver::ContextStructure (const Graphic3d_CStructure& theCStr
if (theCStructure.ContextText.IsDef) if (theCStructure.ContextText.IsDef)
aStructure->SetAspectText (theCStructure.ContextText); aStructure->SetAspectText (theCStructure.ContextText);
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::Connect (const Graphic3d_CStructure& theFather, void OpenGl_GraphicDriver::Connect (const Graphic3d_CStructure& theFather,
@ -106,7 +103,6 @@ void OpenGl_GraphicDriver::RemoveStructure (const Graphic3d_CStructure& theCStru
OpenGl_Structure* aStructure = myMapOfStructure.Find (theCStructure.Id); OpenGl_Structure* aStructure = myMapOfStructure.Find (theCStructure.Id);
myMapOfStructure.UnBind (theCStructure.Id); myMapOfStructure.UnBind (theCStructure.Id);
OpenGl_Element::Destroy (GetSharedContext(), aStructure); OpenGl_Element::Destroy (GetSharedContext(), aStructure);
InvalidateAllWorkspaces();
} }
void OpenGl_GraphicDriver::Structure (Graphic3d_CStructure& theCStructure) void OpenGl_GraphicDriver::Structure (Graphic3d_CStructure& theCStructure)
@ -115,9 +111,6 @@ void OpenGl_GraphicDriver::Structure (Graphic3d_CStructure& theCStructure)
OpenGl_Structure* aStructure = new OpenGl_Structure(); OpenGl_Structure* aStructure = new OpenGl_Structure();
aStructure->SetDegenerateModel (theCStructure.ContextFillArea.DegenerationMode,
theCStructure.ContextFillArea.SkipRatio);
Standard_Integer aStatus = 0; Standard_Integer aStatus = 0;
if (theCStructure.highlight) aStatus |= OPENGL_NS_HIGHLIGHT; if (theCStructure.highlight) aStatus |= OPENGL_NS_HIGHLIGHT;
if (!theCStructure.visible) aStatus |= OPENGL_NS_HIDE; if (!theCStructure.visible) aStatus |= OPENGL_NS_HIDE;
@ -125,7 +118,6 @@ void OpenGl_GraphicDriver::Structure (Graphic3d_CStructure& theCStructure)
theCStructure.ptrStructure = aStructure; theCStructure.ptrStructure = aStructure;
myMapOfStructure.Bind (theCStructure.Id, aStructure); myMapOfStructure.Bind (theCStructure.Id, aStructure);
InvalidateAllWorkspaces();
} }
//======================================================================= //=======================================================================

View File

@ -467,13 +467,6 @@ void OpenGl_GraphicDriver::TransformStructure (const Graphic3d_CStructure& ACStr
astructure->SetTransformation(&(ACStructure.Transformation[0][0])); astructure->SetTransformation(&(ACStructure.Transformation[0][0]));
} }
void OpenGl_GraphicDriver::DegenerateStructure (const Graphic3d_CStructure& ACStructure)
{
OpenGl_Structure *astructure = (OpenGl_Structure *)ACStructure.ptrStructure;
if (astructure)
astructure->SetDegenerateModel( ACStructure.ContextFillArea.DegenerationMode, ACStructure.ContextFillArea.SkipRatio );
}
void OpenGl_GraphicDriver::Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag) void OpenGl_GraphicDriver::Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
{ {
const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView; const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;

View File

@ -160,7 +160,6 @@ void OpenGl_Group::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
} }
// Render group elements // Render group elements
Handle(OpenGl_Texture) aPrevTexture; // temporary disabled texture
for (OpenGl_ElementNode* aNodeIter = myFirst; aNodeIter != NULL; aNodeIter = aNodeIter->next) for (OpenGl_ElementNode* aNodeIter = myFirst; aNodeIter != NULL; aNodeIter = aNodeIter->next)
{ {
switch (aNodeIter->type) switch (aNodeIter->type)
@ -171,28 +170,10 @@ void OpenGl_Group::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
case TelText: case TelText:
{ {
glDisable (GL_LIGHTING); glDisable (GL_LIGHTING);
if (isImmediate) if (isImmediate)
{ {
glDepthMask (GL_FALSE); glDepthMask (GL_FALSE);
} }
else if ((theWorkspace->NamedStatus & OPENGL_NS_ANIMATION) != 0 &&
(theWorkspace->NamedStatus & OPENGL_NS_WIREFRAME) == 0 &&
theWorkspace->DegenerateModel != 0)
{
glDisable (GL_DEPTH_TEST);
if (theWorkspace->NamedStatus & OPENGL_NS_TEXTURE)
{
aPrevTexture = theWorkspace->DisableTexture();
}
theWorkspace->NamedStatus |= OPENGL_NS_WIREFRAME;
}
if (!aPrevTexture.IsNull())
{
theWorkspace->EnableTexture (aPrevTexture);
aPrevTexture.Nullify();
}
aNodeIter->elem->Render (theWorkspace); aNodeIter->elem->Render (theWorkspace);
break; break;
@ -207,13 +188,6 @@ void OpenGl_Group::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
{ {
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
} }
else if ((theWorkspace->NamedStatus & OPENGL_NS_ANIMATION) != 0 &&
(theWorkspace->NamedStatus & OPENGL_NS_WIREFRAME) != 0 &&
theWorkspace->DegenerateModel < 2)
{
glEnable (GL_DEPTH_TEST);
theWorkspace->NamedStatus &= ~OPENGL_NS_WIREFRAME;
}
if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT)
{ {

View File

@ -17,26 +17,20 @@
// purpose or non-infringement. Please see the License for the specific terms // purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License. // and conditions governing the rights and limitations under the License.
#ifndef _OpenGl_NamedStatus_Header #ifndef _OpenGl_NamedStatus_Header
#define _OpenGl_NamedStatus_Header #define _OpenGl_NamedStatus_Header
// Dynamic fields // Dynamic fields
#define OPENGL_NS_HIDE (1<<0) #define OPENGL_NS_HIDE (1<<0)
#define OPENGL_NS_HIGHLIGHT (1<<1) #define OPENGL_NS_HIGHLIGHT (1<<1)
#define OPENGL_NS_WIREFRAME (1<<2) #define OPENGL_NS_RESMAT (1<<2)
#define OPENGL_NS_RESMAT (1<<3) #define OPENGL_NS_ADD (1<<3)
#define OPENGL_NS_ADD (1<<4) #define OPENGL_NS_IMMEDIATE (1<<4)
#define OPENGL_NS_IMMEDIATE (1<<5) #define OPENGL_NS_TEXTURE (1<<5)
#define OPENGL_NS_TEXTURE (1<<6) #define OPENGL_NS_ANTIALIASING (1<<6)
#define OPENGL_NS_ANTIALIASING (1<<7) #define OPENGL_NS_2NDPASSNEED (1<<7)
#define OPENGL_NS_ANIMATION (1<<8) #define OPENGL_NS_2NDPASSDO (1<<8)
#define OPENGL_NS_UPDATEAM (1<<9) #define OPENGL_NS_FORBIDSETTEX (1<<9)
#define OPENGL_NS_DEGENERATION (1<<10) #define OPENGL_NS_WHITEBACK (1<<10)
#define OPENGL_NS_2NDPASSNEED (1<<11)
#define OPENGL_NS_2NDPASSDO (1<<12)
#define OPENGL_NS_FORBIDSETTEX (1<<13)
#define OPENGL_NS_FLIST (1<<14)
#define OPENGL_NS_WHITEBACK (1<<15)
#endif //_OpenGl_NamedStatus_Header #endif //_OpenGl_NamedStatus_Header

View File

@ -589,7 +589,7 @@ void OpenGl_Polygon::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
front_lighting_model = 0; front_lighting_model = 0;
} }
if( interior_style != Aspect_IS_EMPTY && AWorkspace->DegenerateModel < 2 ) if( interior_style != Aspect_IS_EMPTY)
{ {
if ( front_lighting_model ) if ( front_lighting_model )
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
@ -609,14 +609,7 @@ void OpenGl_Polygon::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
glDisable(GL_TEXTURE_1D); glDisable(GL_TEXTURE_1D);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
switch ( AWorkspace->DegenerateModel ) draw_edges ( edge_colour, interior_style, AWorkspace );
{
default:
draw_edges ( edge_colour, interior_style, AWorkspace );
break;
case 3: /* marker degeneration */
break;
}
glPopAttrib(); /* skt: GL_ENABLE_BIT*/ glPopAttrib(); /* skt: GL_ENABLE_BIT*/
} }

View File

@ -59,7 +59,7 @@ void OpenGl_Polyline::Render (const Handle(OpenGl_Workspace)& theWorkspace) cons
glDisable (GL_TEXTURE_1D); glDisable (GL_TEXTURE_1D);
glDisable (GL_TEXTURE_2D); glDisable (GL_TEXTURE_2D);
glBegin (theWorkspace->DegenerateModel != 3 ? GL_LINE_STRIP : GL_POINTS); glBegin (GL_LINE_STRIP);
// Use highlight colors // Use highlight colors
glColor3fv ((theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) ? theWorkspace->HighlightColor->rgb : anAspectLine->Color().rgb); glColor3fv ((theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) ? theWorkspace->HighlightColor->rgb : anAspectLine->Color().rgb);

File diff suppressed because it is too large Load Diff

View File

@ -76,26 +76,6 @@ private:
void DrawEdges (const TEL_COLOUR* theEdgeColour, void DrawEdges (const TEL_COLOUR* theEdgeColour,
const Handle(OpenGl_Workspace)& theWorkspace) const; const Handle(OpenGl_Workspace)& theWorkspace) const;
void DrawDegeneratesAsPoints (const TEL_COLOUR* theEdgeColour,
const float theSkipRatio) const;
void DrawDegeneratesAsLines (const TEL_COLOUR* theEdgeColour,
const Handle(OpenGl_Workspace)& theWorkspace) const;
void DrawDegeneratesAsBBoxs (const TEL_COLOUR* theEdgeColour) const;
void DrawDegeneratesPointsAsPoints() const;
void DrawDegeneratesLinesAsPoints() const;
void DrawDegeneratesLinesAsLines (const float theSkipRatio) const;
void DrawDegeneratesTrianglesAsPoints() const;
void DrawDegeneratesTrianglesAsLines (const float theSkipRatio) const;
void DrawDegeneratesTrianglestripsAsPoints() const;
void DrawDegeneratesTrianglestripsAsLines (const float theSkipRatio) const;
void DrawDegeneratesQuadranglesAsPoints() const;
void DrawDegeneratesQuadranglesAsLines (const float theSkipRatio) const;
void DrawDegeneratesQuadranglestripsAsPoints() const;
void DrawDegeneratesQuadranglestripsAsLines (const float theSkipRatio) const;
void DrawDegeneratesPolygonsAsPoints() const;
void DrawDegeneratesPolygonsAsLines (const float theSkipRatio) const;
protected: protected:
//! Destructor //! Destructor

View File

@ -45,7 +45,6 @@ static void call_util_transpose_mat (float tmat[16], float mat[4][4])
OpenGl_Structure::OpenGl_Structure () OpenGl_Structure::OpenGl_Structure ()
: myTransformation(NULL), : myTransformation(NULL),
myTransPers(NULL), myTransPers(NULL),
myDegenerateModel(NULL),
myAspectLine(NULL), myAspectLine(NULL),
myAspectFace(NULL), myAspectFace(NULL),
myAspectMarker(NULL), myAspectMarker(NULL),
@ -64,7 +63,6 @@ OpenGl_Structure::~OpenGl_Structure()
Release (Handle(OpenGl_Context)()); Release (Handle(OpenGl_Context)());
delete myTransformation; myTransformation = NULL; delete myTransformation; myTransformation = NULL;
delete myTransPers; myTransPers = NULL; delete myTransPers; myTransPers = NULL;
delete myDegenerateModel; myDegenerateModel = NULL;
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
@ -92,17 +90,6 @@ void OpenGl_Structure::SetTransformPersistence(const CALL_DEF_TRANSFORM_PERSISTE
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void OpenGl_Structure::SetDegenerateModel (const Standard_Integer AMode, const float ASkipRatio)
{
if (!myDegenerateModel)
myDegenerateModel = new DEGENERATION;
myDegenerateModel->mode = AMode;
myDegenerateModel->skipRatio = ASkipRatio;
}
/*----------------------------------------------------------------------*/
void OpenGl_Structure::SetAspectLine (const CALL_DEF_CONTEXTLINE &AContext) void OpenGl_Structure::SetAspectLine (const CALL_DEF_CONTEXTLINE &AContext)
{ {
if (!myAspectLine) if (!myAspectLine)
@ -340,26 +327,6 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
trans_pers = AWorkspace->ActiveView()->BeginTransformPersistence( myTransPers ); trans_pers = AWorkspace->ActiveView()->BeginTransformPersistence( myTransPers );
} }
// Apply degeneration
if (myDegenerateModel)
{
if ( AWorkspace->NamedStatus & OPENGL_NS_DEGENERATION )
{
AWorkspace->DegenerateModel = myDegenerateModel->mode;
switch ( AWorkspace->DegenerateModel )
{
case 0: break;
default:
glLineWidth ( 1.0 );
glDisable ( GL_LINE_STIPPLE );
case 1:
AWorkspace->SkipRatio = myDegenerateModel->skipRatio;
}
}
}
// Apply aspects // Apply aspects
const OpenGl_AspectLine *aspect_line = AWorkspace->AspectLine(Standard_False); const OpenGl_AspectLine *aspect_line = AWorkspace->AspectLine(Standard_False);
const OpenGl_AspectFace *aspect_face = AWorkspace->AspectFace(Standard_False); const OpenGl_AspectFace *aspect_face = AWorkspace->AspectFace(Standard_False);

View File

@ -47,8 +47,6 @@ public:
void SetTransformPersistence (const CALL_DEF_TRANSFORM_PERSISTENCE &ATransPers); void SetTransformPersistence (const CALL_DEF_TRANSFORM_PERSISTENCE &ATransPers);
void SetDegenerateModel (const Standard_Integer AMode, const float ASkipRatio);
void SetAspectLine (const CALL_DEF_CONTEXTLINE &AContext); void SetAspectLine (const CALL_DEF_CONTEXTLINE &AContext);
void SetAspectFace (const Handle(OpenGl_Context)& theCtx, void SetAspectFace (const Handle(OpenGl_Context)& theCtx,
const CALL_DEF_CONTEXTFILLAREA& theAspect); const CALL_DEF_CONTEXTFILLAREA& theAspect);
@ -103,7 +101,6 @@ protected:
//Structure_LABBegin //Structure_LABBegin
OpenGl_Matrix* myTransformation; OpenGl_Matrix* myTransformation;
TEL_TRANSFORM_PERSISTENCE* myTransPers; TEL_TRANSFORM_PERSISTENCE* myTransPers;
DEGENERATION* myDegenerateModel;
OpenGl_AspectLine* myAspectLine; OpenGl_AspectLine* myAspectLine;
OpenGl_AspectFace* myAspectFace; OpenGl_AspectFace* myAspectFace;
OpenGl_AspectMarker* myAspectMarker; OpenGl_AspectMarker* myAspectMarker;

View File

@ -382,11 +382,6 @@ void OpenGl_Text::StringSize (const Handle(OpenGl_Context)& theCtx,
// ======================================================================= // =======================================================================
void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
{ {
if (theWorkspace->DegenerateModel > 0 && theWorkspace->SkipRatio >= 1.0f)
{
return;
}
const OpenGl_AspectText* aTextAspect = theWorkspace->AspectText (Standard_True); const OpenGl_AspectText* aTextAspect = theWorkspace->AspectText (Standard_True);
const Handle(OpenGl_Texture) aPrevTexture = theWorkspace->DisableTexture(); const Handle(OpenGl_Texture) aPrevTexture = theWorkspace->DisableTexture();

View File

@ -100,11 +100,8 @@ OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext)
myVisualization(AContext.Visualization), myVisualization(AContext.Visualization),
myIntShadingMethod(TEL_SM_GOURAUD), myIntShadingMethod(TEL_SM_GOURAUD),
myAntiAliasing(Standard_False), myAntiAliasing(Standard_False),
myAnimationListIndex(0),
myAnimationListReady(Standard_False),
myTransPers(&myDefaultTransPers), myTransPers(&myDefaultTransPers),
myIsTransPers(Standard_False), myIsTransPers(Standard_False)
myResetFLIST(Standard_False)
{ {
// Initialize matrices // Initialize matrices
memcpy(myOrientationMatrix,myDefaultMatrix,sizeof(Tmatrix3)); memcpy(myOrientationMatrix,myDefaultMatrix,sizeof(Tmatrix3));
@ -144,11 +141,6 @@ void OpenGl_View::ReleaseGlResources (const Handle(OpenGl_Context)& theCtx)
glDeleteTextures (1, (GLuint*)&(myBgTexture.TexId)); glDeleteTextures (1, (GLuint*)&(myBgTexture.TexId));
myBgTexture.TexId = 0; myBgTexture.TexId = 0;
} }
if (myAnimationListIndex)
{
glDeleteLists ((GLuint )myAnimationListIndex, 1);
myAnimationListIndex = 0;
}
} }
void OpenGl_View::SetTextureEnv (const Handle(OpenGl_Context)& theCtx, void OpenGl_View::SetTextureEnv (const Handle(OpenGl_Context)& theCtx,
@ -172,10 +164,9 @@ void OpenGl_View::SetTextureEnv (const Handle(OpenGl_Context)& theCtx,
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void OpenGl_View::SetBackfacing (const Standard_Integer AMode) void OpenGl_View::SetBackfacing (const Standard_Integer theMode)
{ {
myBackfacing = AMode; myBackfacing = theMode;
myResetFLIST = Standard_True;
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/

View File

@ -246,14 +246,9 @@ public:
OpenGl_LayerList myZLayers; OpenGl_LayerList myZLayers;
int myAnimationListIndex;
Standard_Boolean myAnimationListReady;
const TEL_TRANSFORM_PERSISTENCE *myTransPers; const TEL_TRANSFORM_PERSISTENCE *myTransPers;
Standard_Boolean myIsTransPers; Standard_Boolean myIsTransPers;
Standard_Boolean myResetFLIST;
public: public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
}; };

View File

@ -637,13 +637,6 @@ void OpenGl_View::Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACUnderLayer,
const Aspect_CLayer2d& ACOverLayer) const Aspect_CLayer2d& ACOverLayer)
{ {
// Reset FLIST status after modification of myBackfacing
if (myResetFLIST)
{
AWorkspace->NamedStatus &= ~OPENGL_NS_FLIST;
myResetFLIST = Standard_False;
}
// Store and disable current clipping planes // Store and disable current clipping planes
GLint maxplanes; GLint maxplanes;
glGetIntegerv(GL_MAX_CLIP_PLANES, &maxplanes); glGetIntegerv(GL_MAX_CLIP_PLANES, &maxplanes);
@ -1054,123 +1047,73 @@ D = -[Px,Py,Pz] dot |Nx|
AWorkspace->NamedStatus &= ~OPENGL_NS_ANTIALIASING; AWorkspace->NamedStatus &= ~OPENGL_NS_ANTIALIASING;
} }
Standard_Boolean isAnimationListOpen = Standard_False; // Clear status bitfields
AWorkspace->NamedStatus &= ~(OPENGL_NS_2NDPASSNEED | OPENGL_NS_2NDPASSDO);
// Request for update of animation mode? // Added PCT for handling of textures
if ( (AWorkspace->NamedStatus & OPENGL_NS_UPDATEAM) != 0 ) switch (mySurfaceDetail)
{ {
// Request to rebuild display list case Visual3d_TOD_NONE:
myAnimationListReady = Standard_False; AWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
// Reset request for update of animation mode AWorkspace->DisableTexture();
AWorkspace->NamedStatus &= ~OPENGL_NS_UPDATEAM; // Render the view
} RenderStructs(AWorkspace);
break;
// Is in animation mode? case Visual3d_TOD_ENVIRONMENT:
if ( AWorkspace->NamedStatus & OPENGL_NS_ANIMATION ) AWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
{ AWorkspace->EnableTexture (myTextureEnv);
// Is the animation list ready? // Render the view
if (myAnimationListReady) RenderStructs(AWorkspace);
{ AWorkspace->DisableTexture();
// Execute the animation list break;
glCallList(myAnimationListIndex);
} case Visual3d_TOD_ALL:
else // First pass
{ AWorkspace->NamedStatus &= ~OPENGL_NS_FORBIDSETTEX;
// Update the animation list // Render the view
if ( AWorkspace->NamedStatus & OPENGL_NS_FLIST ) RenderStructs(AWorkspace);
AWorkspace->DisableTexture();
// Second pass
if (AWorkspace->NamedStatus & OPENGL_NS_2NDPASSNEED)
{ {
if (myAnimationListIndex == 0) AWorkspace->NamedStatus |= OPENGL_NS_2NDPASSDO;
myAnimationListIndex = glGenLists(1);
if (myAnimationListIndex != 0)
{
glNewList(myAnimationListIndex, GL_COMPILE_AND_EXECUTE);
isAnimationListOpen = Standard_True;
}
}
else
AWorkspace->NamedStatus |= OPENGL_NS_FLIST;
}
}
else
myAnimationListReady = Standard_False;
if (!myAnimationListReady)
{
// Clear status bitfields
AWorkspace->NamedStatus &= ~(OPENGL_NS_2NDPASSNEED | OPENGL_NS_2NDPASSDO);
// Added PCT for handling of textures
switch (mySurfaceDetail)
{
case Visual3d_TOD_NONE:
AWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
AWorkspace->DisableTexture();
// Render the view
RenderStructs(AWorkspace);
break;
case Visual3d_TOD_ENVIRONMENT:
AWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
AWorkspace->EnableTexture (myTextureEnv); AWorkspace->EnableTexture (myTextureEnv);
// Render the view
RenderStructs(AWorkspace);
AWorkspace->DisableTexture();
break;
case Visual3d_TOD_ALL: /* sauvegarde de quelques parametres OpenGL */
// First pass GLint blend_dst, blend_src;
AWorkspace->NamedStatus &= ~OPENGL_NS_FORBIDSETTEX; GLint zbuff_f;
GLboolean zbuff_w;
glGetBooleanv(GL_DEPTH_WRITEMASK, &zbuff_w);
glGetIntegerv(GL_DEPTH_FUNC, &zbuff_f);
glGetIntegerv(GL_BLEND_DST, &blend_dst);
glGetIntegerv(GL_BLEND_SRC, &blend_src);
GLboolean zbuff_state = glIsEnabled(GL_DEPTH_TEST);
GLboolean blend_state = glIsEnabled(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDepthFunc(GL_EQUAL);
glDepthMask(GL_FALSE);
glEnable(GL_DEPTH_TEST);
AWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
// Render the view // Render the view
RenderStructs(AWorkspace); RenderStructs(AWorkspace);
AWorkspace->DisableTexture(); AWorkspace->DisableTexture();
// Second pass /* restauration des parametres OpenGL */
if (AWorkspace->NamedStatus & OPENGL_NS_2NDPASSNEED) glBlendFunc(blend_src, blend_dst);
{ if (!blend_state) glDisable(GL_BLEND);
AWorkspace->NamedStatus |= OPENGL_NS_2NDPASSDO;
AWorkspace->EnableTexture (myTextureEnv);
/* sauvegarde de quelques parametres OpenGL */ glDepthFunc(zbuff_f);
GLint blend_dst, blend_src; glDepthMask(zbuff_w);
GLint zbuff_f; if (!zbuff_state) glDisable(GL_DEPTH_FUNC);
GLboolean zbuff_w; }
glGetBooleanv(GL_DEPTH_WRITEMASK, &zbuff_w); break;
glGetIntegerv(GL_DEPTH_FUNC, &zbuff_f);
glGetIntegerv(GL_BLEND_DST, &blend_dst);
glGetIntegerv(GL_BLEND_SRC, &blend_src);
GLboolean zbuff_state = glIsEnabled(GL_DEPTH_TEST);
GLboolean blend_state = glIsEnabled(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDepthFunc(GL_EQUAL);
glDepthMask(GL_FALSE);
glEnable(GL_DEPTH_TEST);
AWorkspace->NamedStatus |= OPENGL_NS_FORBIDSETTEX;
// Render the view
RenderStructs(AWorkspace);
AWorkspace->DisableTexture();
/* restauration des parametres OpenGL */
glBlendFunc(blend_src, blend_dst);
if (!blend_state) glDisable(GL_BLEND);
glDepthFunc(zbuff_f);
glDepthMask(zbuff_w);
if (!zbuff_state) glDisable(GL_DEPTH_FUNC);
}
break;
}
if (isAnimationListOpen)
{
glEndList();
myAnimationListReady = Standard_True;
}
} }
// Resetting GL parameters according to the default aspects // Resetting GL parameters according to the default aspects
@ -1265,14 +1208,7 @@ void OpenGl_View::RenderStructs (const Handle(OpenGl_Workspace) &AWorkspace)
myZLayers.Render (AWorkspace); myZLayers.Render (AWorkspace);
//TsmPopAttri(); /* restore previous graphics context; before update lights */ //TsmPopAttri(); /* restore previous graphics context; before update lights */
glPopAttrib();
if ( AWorkspace->DegenerateModel > 1 )
{
glLineWidth ( aspect_line->Width() );
if ( aspect_line->Type() != Aspect_TOL_SOLID ) glEnable ( GL_LINE_STIPPLE );
}
glPopAttrib ();
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/

View File

@ -73,8 +73,6 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_Display)& theDisplay,
const Handle(OpenGl_Context)& theShareCtx) const Handle(OpenGl_Context)& theShareCtx)
: OpenGl_Window (theDisplay, theCWindow, theGContext, theShareCtx), : OpenGl_Window (theDisplay, theCWindow, theGContext, theShareCtx),
NamedStatus (0), NamedStatus (0),
DegenerateModel (0),
SkipRatio (0.F),
HighlightColor (&myDefaultHighlightColor), HighlightColor (&myDefaultHighlightColor),
// //
myIsTransientOpen (Standard_False), myIsTransientOpen (Standard_False),
@ -146,8 +144,6 @@ Standard_Boolean OpenGl_Workspace::Activate()
if (!OpenGl_Window::Activate()) if (!OpenGl_Window::Activate())
return Standard_False; return Standard_False;
DegenerateModel = 0;
SkipRatio = 0.0f;
ViewMatrix_applied = &myDefaultMatrix; ViewMatrix_applied = &myDefaultMatrix;
StructureMatrix_applied = &myDefaultMatrix; StructureMatrix_applied = &myDefaultMatrix;
@ -162,11 +158,7 @@ Standard_Boolean OpenGl_Workspace::Activate()
// ======================================================================= // =======================================================================
void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag) void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag)
{ {
if ((myUseTransparency ? 1 : 0) != (theFlag ? 1 : 0)) myUseTransparency = theFlag;
{
myUseTransparency = theFlag;
EraseAnimation();
}
} }
//======================================================================= //=======================================================================

View File

@ -110,12 +110,6 @@ public:
void DisplayCallback (const Graphic3d_CView& theCView, int theReason); void DisplayCallback (const Graphic3d_CView& theCView, int theReason);
// szvgl: defined in OpenGl_Workspace_1.cxx
void BeginAnimation (const Standard_Boolean theUseDegeneration,
const Standard_Boolean theUpdateAM);
void EndAnimation();
void EraseAnimation();
Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer); Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer);
Standard_Boolean BeginAddMode(); Standard_Boolean BeginAddMode();
void EndAddMode(); void EndAddMode();
@ -143,9 +137,6 @@ public:
Standard_Integer NamedStatus; Standard_Integer NamedStatus;
Standard_Integer DegenerateModel;
Standard_ShortReal SkipRatio;
const TEL_COLOUR* HighlightColor; const TEL_COLOUR* HighlightColor;
const OpenGl_Matrix* SetViewMatrix (const OpenGl_Matrix* ); const OpenGl_Matrix* SetViewMatrix (const OpenGl_Matrix* );

View File

@ -1,60 +0,0 @@
// Created on: 2011-09-20
// Created by: Sergey ZERCHANINOV
// Copyright (c) 2011-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <OpenGl_Workspace.hxx>
//call_togl_begin_animation
void OpenGl_Workspace::BeginAnimation (const Standard_Boolean UseDegeneration, const Standard_Boolean UpdateAM)
{
NamedStatus |= OPENGL_NS_ANIMATION;
if (UseDegeneration)
NamedStatus |= OPENGL_NS_DEGENERATION;
else
NamedStatus &= ~OPENGL_NS_DEGENERATION;
if (UpdateAM)
NamedStatus |= OPENGL_NS_UPDATEAM;
else
NamedStatus &= ~OPENGL_NS_UPDATEAM;
NamedStatus &= ~OPENGL_NS_FLIST;
}
/*----------------------------------------------------------------------*/
//call_togl_end_animation
void OpenGl_Workspace::EndAnimation ()
{
if( (NamedStatus & OPENGL_NS_ANIMATION) == 0 ) return;
NamedStatus &= ~(OPENGL_NS_ANIMATION | OPENGL_NS_DEGENERATION | OPENGL_NS_UPDATEAM);
}
/*----------------------------------------------------------------------*/
/*
* Permet de terminer effectivement le mode Animation.
* Ceci est realise des qu'une structure a ete modifiee.
*/
//call_togl_erase_animation_mode
void OpenGl_Workspace::EraseAnimation ()
{
NamedStatus &= ~(OPENGL_NS_ANIMATION | OPENGL_NS_DEGENERATION | OPENGL_NS_UPDATEAM | OPENGL_NS_FLIST);
}
/*----------------------------------------------------------------------*/

View File

@ -87,7 +87,6 @@ void OpenGl_Workspace::ClearImmediatMode (const Graphic3d_CView& theCView,
glGetBooleanv (GL_DOUBLEBUFFER, &isDoubleBuffer); glGetBooleanv (GL_DOUBLEBUFFER, &isDoubleBuffer);
if (!myBackBufferRestored || !myTransientDrawToFront || !isDoubleBuffer) if (!myBackBufferRestored || !myTransientDrawToFront || !isDoubleBuffer)
{ {
EraseAnimation();
Redraw1 (theCView, *((CALL_DEF_LAYER* )theCView.ptrUnderLayer), *((CALL_DEF_LAYER* )theCView.ptrOverLayer), theToFlush); Redraw1 (theCView, *((CALL_DEF_LAYER* )theCView.ptrUnderLayer), *((CALL_DEF_LAYER* )theCView.ptrOverLayer), theToFlush);
// After a redraw, // After a redraw,

View File

@ -428,13 +428,9 @@ const OpenGl_Matrix * OpenGl_Workspace::SetViewMatrix(const OpenGl_Matrix *AMatr
OpenGl_Transposemat3( &lmat, StructureMatrix_applied ); OpenGl_Transposemat3( &lmat, StructureMatrix_applied );
glMatrixMode (GL_MODELVIEW); glMatrixMode (GL_MODELVIEW);
OpenGl_Matrix rmat;
if ( (NamedStatus & OPENGL_NS_ANIMATION) == 0 ) OpenGl_Multiplymat3 (&rmat, &lmat, ViewMatrix_applied);
{ glLoadMatrixf ((const GLfloat* )rmat.mat);
OpenGl_Matrix rmat;
OpenGl_Multiplymat3( &rmat, &lmat, ViewMatrix_applied );
glLoadMatrixf((const GLfloat *) rmat.mat);
}
return ViewMatrix_old; return ViewMatrix_old;
} }
@ -450,17 +446,9 @@ const OpenGl_Matrix * OpenGl_Workspace::SetStructureMatrix(const OpenGl_Matrix *
OpenGl_Transposemat3( &lmat, AMatrix ); OpenGl_Transposemat3( &lmat, AMatrix );
glMatrixMode (GL_MODELVIEW); glMatrixMode (GL_MODELVIEW);
OpenGl_Matrix rmat;
if ( (NamedStatus & OPENGL_NS_ANIMATION) == 0 ) OpenGl_Multiplymat3 (&rmat, &lmat, ViewMatrix_applied);
{ glLoadMatrixf ((const GLfloat* )rmat.mat);
OpenGl_Matrix rmat;
OpenGl_Multiplymat3( &rmat, &lmat, ViewMatrix_applied );
glLoadMatrixf((const GLfloat *) rmat.mat);
}
else
{
glMultMatrixf((const GLfloat *) lmat.mat);
}
return StructureMatrix_old; return StructureMatrix_old;
} }

View File

@ -34,7 +34,6 @@ xx-xx-xx : xxx ; Creation.
23-12-97 : FMN ; Suppression TelBackInteriorStyle, TelBackInteriorStyleIndex 23-12-97 : FMN ; Suppression TelBackInteriorStyle, TelBackInteriorStyleIndex
et TelBackInteriorShadingMethod et TelBackInteriorShadingMethod
30-11-98 : FMN ; S3819 : Textes toujours visibles 30-11-98 : FMN ; S3819 : Textes toujours visibles
21-09-99 : EUG : G003 : Degeneration management
16-06-00 : ATS,SPK : G005 : Group of new primitives: TelParray 16-06-00 : ATS,SPK : G005 : Group of new primitives: TelParray
22-03-04 : SAN : OCC4895 High-level interface for controlling polygon offsets 22-03-04 : SAN : OCC4895 High-level interface for controlling polygon offsets
@ -107,7 +106,6 @@ typedef enum
TelTextStyle, TelTextStyle,
TelTextDisplayType, TelTextDisplayType,
TelTextColourSubTitle, TelTextColourSubTitle,
TelDegenerationMode,
TelTextZoomable,//Text Zoomable attributes TelTextZoomable,//Text Zoomable attributes
TelTextAngle,//Text Angle attributes TelTextAngle,//Text Angle attributes
TelTextFontAspect,//Text Font Aspect attributes TelTextFontAspect,//Text Font Aspect attributes

View File

@ -567,9 +567,10 @@ static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, con
ViewerTest::UnsetEventManager(); ViewerTest::UnsetEventManager();
ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext())); ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext()));
if (HLR == 1) { if (HLR == 1)
di << "HLR" << "\n"; {
aNewView->SetDegenerateModeOff(); di << "HLR\n";
aNewView->SetComputedMode (Standard_True);
} }
return 0; return 0;

View File

@ -39,109 +39,6 @@
#include <BRepPrimAPI_MakeBox.hxx> #include <BRepPrimAPI_MakeBox.hxx>
static Standard_Integer BUC60753 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if(argc!=3)
{
di << "Usage : " << argv[0] << " mode (0 <=mode<=5) ratio (0.0<=ration<=1.0)" <<"\n";
return -1;
}
Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
if(myAISContext.IsNull()) {
di << "use 'vinit' command before " << argv[0] << "\n";
return 1;
}
Standard_Real Alpha = M_PI/10.;
Standard_Real CosAlpha = Cos (Alpha);
Standard_Real SinAlpha = Sin (Alpha);
Standard_Real MoinsCosAlpha = Cos (-Alpha);
Standard_Real MoinsSinAlpha = Sin (-Alpha);
TColStd_Array2OfReal TrsfI (0, 3, 0, 3);
TColStd_Array2OfReal TrsfX (0, 3, 0, 3);
TColStd_Array2OfReal TrsfY (0, 3, 0, 3);
TColStd_Array2OfReal TrsfZ (0, 3, 0, 3);
TColStd_Array2OfReal Trsfx (0, 3, 0, 3);
TColStd_Array2OfReal Trsfy (0, 3, 0, 3);
TColStd_Array2OfReal Trsfz (0, 3, 0, 3);
Standard_Integer i,j;
for (i=0; i<=3; i++)
for (j=0; j<=3; j++)
if (i == j) {
TrsfX.SetValue (i, j, 1.0);
TrsfY.SetValue (i, j, 1.0);
TrsfZ.SetValue (i, j, 1.0);
Trsfx.SetValue (i, j, 1.0);
Trsfy.SetValue (i, j, 1.0);
Trsfz.SetValue (i, j, 1.0);
TrsfI.SetValue (i, j, 1.0);
} else {
TrsfX.SetValue (i, j, 0.0);
TrsfY.SetValue (i, j, 0.0);
TrsfZ.SetValue (i, j, 0.0);
Trsfx.SetValue (i, j, 0.0);
Trsfy.SetValue (i, j, 0.0);
Trsfz.SetValue (i, j, 0.0);
TrsfI.SetValue (i, j, 0.0);
}
// Rotation Alpha autour de l'axe X
TrsfX.SetValue (1, 1, CosAlpha);
TrsfX.SetValue (2, 2, CosAlpha);
TrsfX.SetValue (1, 2, -SinAlpha);
TrsfX.SetValue (2, 1, SinAlpha);
// Rotation Alpha autour de l'axe Y
TrsfY.SetValue (0, 0, CosAlpha);
TrsfY.SetValue (2, 2, CosAlpha);
TrsfY.SetValue (0, 2, SinAlpha);
TrsfY.SetValue (2, 0, -SinAlpha);
// Rotation Alpha autour de l'axe Z
TrsfZ.SetValue (0, 0, CosAlpha);
TrsfZ.SetValue (1, 1, CosAlpha);
TrsfZ.SetValue (0, 1, -SinAlpha);
TrsfZ.SetValue (1, 0, SinAlpha);
// Rotation -Alpha autour de l'axe X
Trsfx.SetValue (1, 1, MoinsCosAlpha);
Trsfx.SetValue (2, 2, MoinsCosAlpha);
Trsfx.SetValue (1, 2, -MoinsSinAlpha);
Trsfx.SetValue (2, 1, MoinsSinAlpha);
// Rotation -Alpha autour de l'axe Y
Trsfy.SetValue (0, 0, MoinsCosAlpha);
Trsfy.SetValue (2, 2, MoinsCosAlpha);
Trsfy.SetValue (0, 2, MoinsSinAlpha);
Trsfy.SetValue (2, 0, -MoinsSinAlpha);
// Rotation -Alpha autour de l'axe Z
Trsfz.SetValue (0, 0, MoinsCosAlpha);
Trsfz.SetValue (1, 1, MoinsCosAlpha);
Trsfz.SetValue (0, 1, -MoinsSinAlpha);
Trsfz.SetValue (1, 0, MoinsSinAlpha);
Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
myV3dView->SetAnimationMode(Standard_True,Standard_True);
myAISContext-> SetDegenerateModel((Aspect_TypeOfDegenerateModel) Draw::Atoi(argv[1]),Draw::Atof(argv[2]));
// Timer.Reset ();
// Timer.Start ();
myV3dView->SetAnimationModeOn();
myV3dView->SetComputedMode ( Standard_False );
for (i=0;i<40;i++) {
myV3dView->View()->SetTransform (Trsfz);
myV3dView->View()->Update ();
}
myV3dView->SetAnimationModeOff();
// Timer.Stop ();
// Timer.Show (cout);
return 0;
}
static Standard_Integer OCC162 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC162 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 2 ) { if ( argc != 2 ) {
@ -260,7 +157,6 @@ static Standard_Integer OCC1651 (Draw_Interpretor& di, Standard_Integer argc, co
void QABugs::Commands_8(Draw_Interpretor& theCommands) { void QABugs::Commands_8(Draw_Interpretor& theCommands) {
const char *group = "QABugs"; const char *group = "QABugs";
theCommands.Add("BUC60753", "BUC60753 mode ratio", __FILE__, BUC60753, group);
theCommands.Add("OCC162", "OCC162 name", __FILE__, OCC162, group); theCommands.Add("OCC162", "OCC162 name", __FILE__, OCC162, group);
theCommands.Add("OCC172", "OCC172", __FILE__, OCC172, group); theCommands.Add("OCC172", "OCC172", __FILE__, OCC172, group);
theCommands.Add("OCC204", "OCC204 updateviewer=0/1", __FILE__, OCC204, group); theCommands.Add("OCC204", "OCC204 updateviewer=0/1", __FILE__, OCC204, group);

View File

@ -37,15 +37,6 @@
-- -> Add ConvertToGrid() methods, -- -> Add ConvertToGrid() methods,
-- the Compute() internal method become private. -- the Compute() internal method become private.
-- -> Add SetProjModel() method. -- -> Add SetProjModel() method.
-- EUG - 25/01/00 : G003
-- -> Add methods SetAnimationMode() and
-- AnimationMode()
-- -> Add methods SetComputedMode() and
-- ComputedMode()
-- Warning : SetDegenerateModeOn() and Off()
-- become obsolete.
-- -> Add methods SetBackFacingModel() and
-- BackFacingModel()
-- VKH - 15/11/99 : G004 -- VKH - 15/11/99 : G004
-- -> Add method Dump() -- -> Add method Dump()
-- GG - IMP210200 -- GG - IMP210200
@ -1427,78 +1418,6 @@ is
-- --
returns Boolean from Standard; returns Boolean from Standard;
---------------------------------------------------
-- Category: Methods to modify the class definition
-- Animation Mode
---------------------------------------------------
SetAnimationModeOn ( me : mutable )
is static;
---Level: Advanced
---Purpose: Activates animation mode.
-- When the animation mode is activated in the view,
-- all Graphic3d_Structure are stored in a graphic object.
---Category: Methods to modify the class definition
SetAnimationModeOff ( me : mutable )
is static;
---Level: Advanced
---Purpose: Deactivates the animation mode.
---Category: Methods to modify the class definition
AnimationModeIsOn ( me )
returns Boolean from Standard
is static;
---Level: Advanced
---Purpose: Returns the activity of the animation mode.
---Category: Inquire methods
SetAnimationMode ( me : mutable;
anAnimationFlag : Boolean from Standard = Standard_True;
aDegenerationFlag : Boolean from Standard = Standard_False
) is static;
---Level : Advanced
---Purpose : Enable/Disable animation/degeneration mode
---Category : Methods to modify the class definition
AnimationMode ( me; isDegenerate: out Boolean from Standard )
returns Boolean from Standard
is static;
---Level : Advanced
---Purpose : Returns the animation and degenerate status.
---Category: Inquire methods
---------------------------------------------------
-- Category: Methods to modify the class definition
-- Degenerate Mode
---------------------------------------------------
SetDegenerateModeOn ( me : mutable )
is static;
---Level : Obsolete
---Purpose: Activates degenerate mode.
-- When the degenerate mode is activated in the view,
-- all Graphic3d_Structure with the type TOS_COMPUTED
-- displayed in this view are not computed.
-- Warning: Obsolete method , use SetComputedMode()
---Category: Methods to modify the class definition
SetDegenerateModeOff ( me : mutable )
is static;
---Level : Obsolete
---Purpose: Deactivates the degenerate mode.
-- Category: Methods to modify the class definition
-- Warning: if the computed mode has been disabled in the
-- viewer the mode will remain degenerated.
-- Warning: Obsolete method , use SetComputedMode()
DegenerateModeIsOn ( me )
returns Boolean from Standard
is static;
---Level : Obsolete
---Purpose: Returns the activity of the degenerate mode.
---Category: Inquire methods
SetComputedMode ( me : mutable; aMode : Boolean from Standard ) SetComputedMode ( me : mutable; aMode : Boolean from Standard )
is static; is static;
---Level: Advanced ---Level: Advanced
@ -1576,17 +1495,6 @@ is
-- grid in <me> -- grid in <me>
---Category: Methods to modify the class definition ---Category: Methods to modify the class definition
Tumble ( me : mutable;
NbImages : Integer from Standard = 314;
AnimationMode : Boolean from Standard = Standard_False )
returns Real from Standard
is static;
---Level : Advanced
---Purpose: Animates the view <me>
-- Returns the number of images per second
-- if <AnimationMode> is Standard_True, the animation mode
-- is activated.
Dump ( me: mutable; Dump ( me: mutable;
theFile : CString from Standard; theFile : CString from Standard;
theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB ) theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
@ -1743,7 +1651,6 @@ fields
MyGridEchoGroup : Group from Graphic3d; MyGridEchoGroup : Group from Graphic3d;
MyProjModel : TypeOfProjectionModel from V3d is protected; MyProjModel : TypeOfProjectionModel from V3d is protected;
MyAnimationFlags : Integer from Standard;
MyTransparencyFlag : Boolean from Standard; MyTransparencyFlag : Boolean from Standard;
myImmediateUpdate: Boolean from Standard is protected; myImmediateUpdate: Boolean from Standard is protected;

View File

@ -96,14 +96,6 @@ To solve the problem (for lack of a better solution) I make 2 passes.
// (reported in the viewer) // (reported in the viewer)
// -> Add SetProjModel() methods. // -> Add SetProjModel() methods.
#define G003 //EUG 04-10-99
// -> computed mode management
// Add SetComputedMode(..) method
// -> animation mode management
// Add SetAnimationMode()
// -> backfacing management
// Add SetBackFacingModel() method
#define G004 //VKH 15-11-99 #define G004 //VKH 15-11-99
// -> Add Dump() methods // -> Add Dump() methods
// -> GG 07/03/00 Use the new MMSize() // -> GG 07/03/00 Use the new MMSize()
@ -179,15 +171,7 @@ To solve the problem (for lack of a better solution) I make 2 passes.
#include <Aspect_FontMap.hxx> #include <Aspect_FontMap.hxx>
#include <TColStd_HSequenceOfInteger.hxx> #include <TColStd_HSequenceOfInteger.hxx>
#ifdef G003 #define V3d_FLAG_COMPUTATION 0x00000004
# define V3d_FLAG_ANIMATION 0x00000001
# define V3d_FLAG_DEGENERATION 0x00000002
# define V3d_FLAG_COMPUTATION 0x00000004
#endif // G003
// Tumble
#include <OSD_Timer.hxx>
static OSD_Timer FullTimer;
// Perspective // Perspective
#include <OSD_Environment.hxx> #include <OSD_Environment.hxx>
@ -377,10 +361,6 @@ MyProjModel(V3d_TPM_SCREEN)
#ifndef IMP240100 #ifndef IMP240100
#endif //IMP240100 #endif //IMP240100
#ifdef G003
MyAnimationFlags = 0;
#endif // G003
#ifdef IMP210200 #ifdef IMP210200
MyTransparencyFlag = Standard_False; MyTransparencyFlag = Standard_False;
#endif #endif
@ -423,10 +403,6 @@ MyProjModel(V3d_TPM_SCREEN)
VM->AddView(this) ; VM->AddView(this) ;
Init(); Init();
myImmediateUpdate = Standard_True; myImmediateUpdate = Standard_True;
#ifdef G003
MyAnimationFlags = 0;
#endif
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
@ -3085,103 +3061,6 @@ void V3d_View::Rotation(const Standard_Integer X,
#endif #endif
} }
void V3d_View::SetAnimationModeOn () {
#ifdef G003
if ( MyAnimationFlags & V3d_FLAG_ANIMATION ) {
if( ComputedMode() ) { // Deactivates computed mode during animation
MyAnimationFlags |= V3d_FLAG_COMPUTATION;
Standard_Boolean immediatUpdate = myImmediateUpdate;
myImmediateUpdate = Standard_False;
SetComputedMode(Standard_False);
myImmediateUpdate = immediatUpdate;
}
MyView -> SetAnimationModeOn ( MyAnimationFlags & V3d_FLAG_DEGENERATION );
}
#else
MyView->SetAnimationModeOn();
#endif
}
void V3d_View::SetAnimationModeOff () {
#ifdef G003
if ( MyAnimationFlags & V3d_FLAG_ANIMATION ) {
MyView -> SetAnimationModeOff ();
if ( MyAnimationFlags & V3d_FLAG_COMPUTATION ) {
// Reactivates computed mode after animation
MyAnimationFlags &= ~V3d_FLAG_COMPUTATION;
SetComputedMode(Standard_True);
} else if( MyAnimationFlags & V3d_FLAG_DEGENERATION ) {
Update();
}
}
#else
MyView->SetAnimationModeOff();
#endif
}
Standard_Boolean V3d_View::AnimationModeIsOn () const
{
return MyView->AnimationModeIsOn();
}
#ifdef G003
void V3d_View :: SetAnimationMode
(
const Standard_Boolean anAnimationFlag,
const Standard_Boolean aDegenerationFlag
)
{
if ( anAnimationFlag )
MyAnimationFlags |= V3d_FLAG_ANIMATION;
else
MyAnimationFlags &= ~V3d_FLAG_ANIMATION;
if ( aDegenerationFlag )
MyAnimationFlags |= V3d_FLAG_DEGENERATION;
else
MyAnimationFlags &= ~V3d_FLAG_DEGENERATION;
} // end V3d_View :: SetAnimationMode
Standard_Boolean V3d_View::AnimationMode( Standard_Boolean& isDegenerate ) const
{
isDegenerate = MyAnimationFlags & V3d_FLAG_DEGENERATION;
return MyAnimationFlags & V3d_FLAG_ANIMATION;
}
#endif
void V3d_View::SetDegenerateModeOn()
{
#ifdef G003
SetComputedMode(Standard_False);
#else
MyView->SetDegenerateModeOn();
ImmediateUpdate();
#endif
}
void V3d_View::SetDegenerateModeOff()
{
#ifdef G003
SetComputedMode(Standard_True);
#else
if(myComputedMode) {
MyView->SetDegenerateModeOff();
ImmediateUpdate();
}
#endif
}
Standard_Boolean V3d_View::DegenerateModeIsOn() const
{
#ifdef G003
return !ComputedMode();
#else
return MyView->DegenerateModeIsOn();
#endif
}
#ifdef G003
void V3d_View :: SetComputedMode ( const Standard_Boolean aMode ) void V3d_View :: SetComputedMode ( const Standard_Boolean aMode )
{ {
if( aMode ) { if( aMode ) {
@ -3210,7 +3089,6 @@ V3d_TypeOfBackfacingModel V3d_View :: BackFacingModel () const
{ {
return V3d_TypeOfBackfacingModel(MyView -> BackFacingModel ()); return V3d_TypeOfBackfacingModel(MyView -> BackFacingModel ());
} }
#endif
Standard_Boolean V3d_View::TransientManagerBeginDraw(const Standard_Boolean DoubleBuffer,const Standard_Boolean RetainMode) const Standard_Boolean V3d_View::TransientManagerBeginDraw(const Standard_Boolean DoubleBuffer,const Standard_Boolean RetainMode) const
{ {
@ -3230,16 +3108,9 @@ Standard_Boolean V3d_View::TransientManagerBeginAddDraw() const
void V3d_View::Init() void V3d_View::Init()
{ {
myComputedMode = MyViewer->ComputedMode(); myComputedMode = MyViewer->ComputedMode();
#ifdef G003
if( !myComputedMode || !MyViewer->DefaultComputedMode() ) { if( !myComputedMode || !MyViewer->DefaultComputedMode() ) {
SetComputedMode(Standard_False); SetComputedMode(Standard_False);
} }
#else
if(!myComputedMode)
MyView->SetDegenerateModeOn();
else
if(!MyViewer->DefaultComputedMode()) MyView->SetDegenerateModeOn();
#endif
#ifdef IMP240100 #ifdef IMP240100
OSD_Environment env_walkthrow("CSF_WALKTHROUGH"); OSD_Environment env_walkthrow("CSF_WALKTHROUGH");
@ -3260,42 +3131,6 @@ void V3d_View::Plot()
MyView->Plot(MyPlotter); MyView->Plot(MyPlotter);
} }
Standard_Real V3d_View::Tumble (const Standard_Integer NbImages, const Standard_Boolean AnimationMode)
{
FullTimer.Reset ();
FullTimer.Start ();
if (AnimationMode) MyView->SetAnimationModeOn();
Standard_Integer i;
Standard_Real delta = 0.01;
Standard_Real xangle, yangle;
xangle = yangle = delta*int(NbImages/3);
Rotate (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Standard_True);
for (i=1; i<=int(NbImages/3); i++)
Rotate (delta*i, 0.0, 0.0, 0.0, 0.0, 0.0, Standard_False);
for (i=1; i<=int(NbImages/3); i++)
Rotate (xangle, delta*i, 0.0, 0.0, 0.0, 0.0, Standard_False);
for (i=1; i<=int(NbImages/3); i++)
Rotate (xangle, yangle, delta*i, 0.0, 0.0, 0.0, Standard_False);
if (AnimationMode) MyView->SetAnimationModeOff();
FullTimer.Stop ();
cout << "For " << NbImages << " Images : " << endl;
FullTimer.Show (cout);
cout << flush;
Standard_Real Seconds, CPUtime;
Standard_Integer Minutes, Hours;
FullTimer.Show (Seconds, Minutes, Hours, CPUtime);
cout << "Result " << (AnimationMode ? "with " : "without ")
<< "display list : " << NbImages/CPUtime << " images/Second."
<< endl;
return NbImages/CPUtime;
}
#include <Aspect.hxx> #include <Aspect.hxx>
#include <Visual3d_Layer.hxx> #include <Visual3d_Layer.hxx>

View File

@ -106,8 +106,6 @@ is
-- This limitation might be addressed in some future OCCT releases. -- This limitation might be addressed in some future OCCT releases.
raises BadValue from V3d ; raises BadValue from V3d ;
---Purpose: If the size of the view is <= 0 ---Purpose: If the size of the view is <= 0
-- if ComputedMode is false, only the degenerate mode will be used.
--
-- Warning: Client must creates a graphic driver -- Warning: Client must creates a graphic driver
CreateView (me: mutable) returns mutable View from V3d; CreateView (me: mutable) returns mutable View from V3d;

View File

@ -113,7 +113,6 @@ Handle(V3d_Viewer) ViewerTest_Tool::MakeViewer (const Standard_CString theTitle)
// View // View
Handle (V3d_View) V = a3DViewer->CreateView(); Handle (V3d_View) V = a3DViewer->CreateView();
V->SetDegenerateModeOn();
V->SetWindow(window); V->SetWindow(window);
V->SetZClippingDepth(0.5); V->SetZClippingDepth(0.5);
V->SetZClippingWidth(ZCLIPWIDTH/2.); V->SetZClippingWidth(ZCLIPWIDTH/2.);

View File

@ -129,7 +129,7 @@ static Handle(Graphic3d_GraphicDriver)& GetGraphicDriver()
return aGraphicDriver; return aGraphicDriver;
} }
static Standard_Boolean DegenerateMode = Standard_True; static Standard_Boolean MyHLRIsOn = Standard_False;
#define ZCLIPWIDTH 1. #define ZCLIPWIDTH 1.
@ -280,9 +280,6 @@ void ViewerTest::ViewerInit (const Standard_Integer thePxLeft, const Standard_I
a3DViewer->SetDefaultBackgroundColor(Quantity_NOC_BLACK); a3DViewer->SetDefaultBackgroundColor(Quantity_NOC_BLACK);
Handle (V3d_View) V = ViewerTest::CurrentView(); Handle (V3d_View) V = ViewerTest::CurrentView();
V->SetDegenerateModeOn();
DegenerateMode = V->DegenerateModeIsOn();
// V->SetWindow(VT_GetWindow(), NULL, MyViewProc, NULL); // V->SetWindow(VT_GetWindow(), NULL, MyViewProc, NULL);
V->SetZClippingDepth(0.5); V->SetZClippingDepth(0.5);
@ -352,10 +349,8 @@ void VT_ProcessKeyPress (const char* buf_ret)
else if ( !strcasecmp(buf_ret, "H") ) { else if ( !strcasecmp(buf_ret, "H") ) {
// HLR // HLR
cout << "HLR" << endl; cout << "HLR" << endl;
aView->SetComputedMode (!aView->ComputedMode());
if (aView->DegenerateModeIsOn()) ViewerTest::CurrentView()->SetDegenerateModeOff(); MyHLRIsOn = aView->ComputedMode();
else aView->SetDegenerateModeOn();
DegenerateMode = aView->DegenerateModeIsOn();
} }
else if ( !strcasecmp(buf_ret, "S") ) { else if ( !strcasecmp(buf_ret, "S") ) {
// SHADING // SHADING
@ -557,7 +552,10 @@ void VT_ProcessButton1Release (Standard_Boolean theIsShift)
void VT_ProcessButton3Press() void VT_ProcessButton3Press()
{ {
Start_Rot = 1; Start_Rot = 1;
ViewerTest::CurrentView()->SetDegenerateModeOn(); if (MyHLRIsOn)
{
ViewerTest::CurrentView()->SetComputedMode (Standard_False);
}
ViewerTest::CurrentView()->StartRotation( X_ButtonPress, Y_ButtonPress ); ViewerTest::CurrentView()->StartRotation( X_ButtonPress, Y_ButtonPress );
} }
@ -570,7 +568,10 @@ void VT_ProcessButton3Release()
if (Start_Rot) if (Start_Rot)
{ {
Start_Rot = 0; Start_Rot = 0;
if (!DegenerateMode) ViewerTest::CurrentView()->SetDegenerateModeOff(); if (MyHLRIsOn)
{
ViewerTest::CurrentView()->SetComputedMode (Standard_True);
}
} }
} }

View File

@ -29,7 +29,6 @@
-- 22-09-98; BGN: S3989 (anciennement S3819): report -- 22-09-98; BGN: S3989 (anciennement S3819): report
-- dans Aspect des TypeOfTriedron* -- dans Aspect des TypeOfTriedron*
-- 14-01-00; GG : IMP140100 Add ViewManager pointer -- 14-01-00; GG : IMP140100 Add ViewManager pointer
-- 25-01-00; EUG: G003 Add backfacing model enum.
-- Purpose: Specifications definitives -- Purpose: Specifications definitives
package Visual3d package Visual3d

View File

@ -30,13 +30,6 @@
-- 13-09-99: GG; GER61454 Adds LightLimit() and PlaneLimit() methods -- 13-09-99: GG; GER61454 Adds LightLimit() and PlaneLimit() methods
-- 10-11-99: GG; Add PRO19603 Redraw( area ) method -- 10-11-99: GG; Add PRO19603 Redraw( area ) method
-- 14-01-00: GG; Add IMP140100 ViewManager() method -- 14-01-00: GG; Add IMP140100 ViewManager() method
-- 25-01-00: EUG: G003
-- -> Add backfacing management methods
-- SetBackfacingModel() & BackfacingModel().
-- -> Change SetAnimationModeIsOn() adding degenerate flag
-- -> SetDegenerateModeOn() and Off() become private.
-- Use instead SetComputedMode() for managing
-- HLR in the view.
-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr> -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
-- -> Add Print methods (works only under Windows).- -- -> Add Print methods (works only under Windows).-
-- GG - RIC120302 Add NEW SetWindow method. -- GG - RIC120302 Add NEW SetWindow method.
@ -458,63 +451,6 @@ is
-- orientation saved by the SetViewOrientationDefaut method. -- orientation saved by the SetViewOrientationDefaut method.
---Category: Methods to modify the class definition ---Category: Methods to modify the class definition
---------------------------------------------------
-- Category: Methods to modify the class definition
-- Animation Mode
---------------------------------------------------
SetAnimationModeOn ( me : mutable;
degenerate : Boolean from Standard = Standard_False )
is static;
---Level: Advanced
---Purpose: Activates animation mode with an optional degeneration
-- according to the TypeOfDegenerateModel of each graphic structure
-- When the animation mode is activated in the view,
-- all Graphic3d_Structure are stored in a graphic object.
-- Warning: only ONE view may have animation mode turned on
-- at same time.
---Category: Methods to modify the class definition
SetAnimationModeOff ( me : mutable )
is static;
---Level: Advanced
---Purpose: Deactivates the animation mode.
---Category: Methods to modify the class definition
AnimationModeIsOn ( me )
returns Boolean from Standard
is static;
---Level: Advanced
---Purpose: Returns the activity of the animation mode.
---Category: Inquire methods
---------------------------------------------------
-- Category: Methods to modify the class definition
-- Degenerate Mode
---------------------------------------------------
SetDegenerateModeOn ( me : mutable )
is static private;
---Level: Advanced
---Purpose: Activates degenerate mode.
-- When the degenerate mode is activated in the view,
-- all Graphic3d_Structure with the type TOS_COMPUTED
-- displayed in this view are not computed.
---Category: Methods to modify the class definition
SetDegenerateModeOff ( me : mutable )
is static private;
---Level: Advanced
---Purpose: Deactivates the degenerate mode.
---Category: Methods to modify the class definition
DegenerateModeIsOn ( me )
returns Boolean from Standard
is static;
---Level: Advanced
---Purpose: Returns the activity of the degenerate mode.
---Category: Inquire methods
SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static; SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
---Level: Advanced ---Level: Advanced
---Purpose: Switches computed HLR mode in the view ---Purpose: Switches computed HLR mode in the view

View File

@ -48,7 +48,6 @@
??-11-97 : CAL ; Retrait de la dependance avec math. Calcul developpe. ??-11-97 : CAL ; Retrait de la dependance avec math. Calcul developpe.
??-11-97 : CAL ; Ajout de NumberOfDisplayedStructures ??-11-97 : CAL ; Ajout de NumberOfDisplayedStructures
07-08-97 : PCT ; ajout support texture mapping 07-08-97 : PCT ; ajout support texture mapping
05-01-98 : CAL ; Ajout de AnimationMode
15-01-98 : FMN ; FRA60019 calcul Ratio pour MyViewMappingReset 15-01-98 : FMN ; FRA60019 calcul Ratio pour MyViewMappingReset
15-01-98 : CAL ; Ajout de la transformation d'une TOS_COMPUTED 15-01-98 : CAL ; Ajout de la transformation d'une TOS_COMPUTED
26-01-98 : CAL ; Ajout de la methode HaveTheSameOwner 26-01-98 : CAL ; Ajout de la methode HaveTheSameOwner
@ -85,9 +84,6 @@
#define GER61454 //GG 14-09-99 Activates model clipping planes #define GER61454 //GG 14-09-99 Activates model clipping planes
#define G003 //EUG 30-09-00 Degeneration management
// Backfacing management
#define RIC120302 //GG Add a NEW SetWindow method which enable #define RIC120302 //GG Add a NEW SetWindow method which enable
// to connect a graphic widget and context to OGL. // to connect a graphic widget and context to OGL.
@ -276,16 +272,9 @@ Standard_Real um, vm, uM, vM;
MyMatOfMapIsEvaluated = Standard_False; MyMatOfMapIsEvaluated = Standard_False;
MyMatOfOriIsEvaluated = Standard_False; MyMatOfOriIsEvaluated = Standard_False;
DegenerateModeIsActive = Standard_False;
AnimationModeIsActive = Standard_False;
IsInitialized = Standard_False; IsInitialized = Standard_False;
#ifdef G003
MyCView.IsDegenerates = 0;
MyCView.IsDegeneratesPrev = 0;
ComputedModeIsActive = Standard_False; ComputedModeIsActive = Standard_False;
MyCView.Backfacing = 0; MyCView.Backfacing = 0;
#endif // G003
MyCView.ptrUnderLayer = 0; MyCView.ptrUnderLayer = 0;
MyCView.ptrOverLayer = 0; MyCView.ptrOverLayer = 0;
@ -415,12 +404,7 @@ Standard_Real um, vm, uM, vM;
MyMatOfOriIsEvaluated = Standard_False; MyMatOfOriIsEvaluated = Standard_False;
IsInitialized = Standard_False; IsInitialized = Standard_False;
#ifdef G003
AnimationModeIsActive = Standard_False;
MyCView.IsDegenerates = 0;
MyCView.IsDegeneratesPrev = 0;
ComputedModeIsActive = Standard_False; ComputedModeIsActive = Standard_False;
#endif // G003
MyCView.ptrUnderLayer = 0; MyCView.ptrUnderLayer = 0;
MyCView.ptrOverLayer = 0; MyCView.ptrOverLayer = 0;
@ -1935,11 +1919,7 @@ void Visual3d_View::ChangeDisplayPriority (const Handle(Graphic3d_Structure)& AS
if (! IsDisplayed (AStructure)) return; if (! IsDisplayed (AStructure)) return;
Standard_Integer Index = IsComputed (AStructure); Standard_Integer Index = IsComputed (AStructure);
#ifdef G003 if (Index != 0 && ComputedMode())
if ( Index != 0 && ComputedMode () && !DegenerateModeIsOn () )
#else
if ((Index != 0) && (! DegenerateModeIsOn ()))
#endif // G003
{ {
#ifdef TRACE #ifdef TRACE
Standard_Integer StructId = MyCOMPUTEDSequence.Value (Index)->Identification (); Standard_Integer StructId = MyCOMPUTEDSequence.Value (Index)->Identification ();
@ -2120,14 +2100,10 @@ Standard_Integer Index = IsComputed (AStructure);
return; return;
} }
// Mode degenerated active if (!ComputedMode())
#ifdef G003 {
if ( !ComputedMode () || DegenerateModeIsOn () ) Answer = Visual3d_TOA_YES;
Answer = Visual3d_TOA_YES; }
#else
if (DegenerateModeIsOn ()) Answer = Visual3d_TOA_YES;
;
#endif // G003
if (Answer == Visual3d_TOA_YES ) { if (Answer == Visual3d_TOA_YES ) {
#ifdef TRACE_DISPLAY #ifdef TRACE_DISPLAY
@ -2364,13 +2340,10 @@ Standard_Integer StructId;
if (IsDisplayed (AStructure)) { if (IsDisplayed (AStructure)) {
Visual3d_TypeOfAnswer Answer = AcceptDisplay (AStructure); Visual3d_TypeOfAnswer Answer = AcceptDisplay (AStructure);
// Degenerated mode is active if (!ComputedMode())
#ifdef G003 {
if ( !ComputedMode () || DegenerateModeIsOn () ) Answer = Visual3d_TOA_YES;
Answer = Visual3d_TOA_YES; }
#else
if (DegenerateModeIsOn ()) Answer = Visual3d_TOA_YES;
#endif // G003
if (Answer != Visual3d_TOA_COMPUTE) { if (Answer != Visual3d_TOA_COMPUTE) {
MyGraphicDriver->EraseStructure ( MyGraphicDriver->EraseStructure (
@ -2387,12 +2360,8 @@ Standard_Integer Index = IsComputed (AStructure);
cout << "Index : " << Index << "\n"; cout << "Index : " << Index << "\n";
cout << flush; cout << flush;
#endif #endif
#ifdef G003
if ( Index != 0 && ComputedMode () && if (Index != 0 && ComputedMode())
!DegenerateModeIsOn () )
#else
if ((Index != 0) && (! DegenerateModeIsOn ()))
#endif // G003
{ {
StructId = StructId =
MyCOMPUTEDSequence.Value (Index)->Identification (); MyCOMPUTEDSequence.Value (Index)->Identification ();
@ -3021,12 +2990,10 @@ Standard_Integer Length = MyCOMPUTEDSequence.Length ();
for (i=1; i<=Length; i++) for (i=1; i<=Length; i++)
(MyCOMPUTEDSequence.Value (i))->SetHLRValidation (Standard_False); (MyCOMPUTEDSequence.Value (i))->SetHLRValidation (Standard_False);
// if the degenerated node is active, nothing is recomputed if (!ComputedMode())
#ifdef G003 {
if ( DegenerateModeIsOn () || !ComputedMode () ) return; return;
#else }
if (DegenerateModeIsOn ()) return;
#endif // G003
/* /*
* Force HLRValidation to False on all structures * Force HLRValidation to False on all structures
@ -3046,10 +3013,6 @@ Standard_Integer Length = MyCOMPUTEDSequence.Length ();
* Remove structures that were calculated for the * Remove structures that were calculated for the
* previous orientation. * previous orientation.
* Recalculation of new structures. * Recalculation of new structures.
* Passage of the degenerated mode ON to OFF =>
* Remove structures that were calculated before
* the degenerated mode passed to ON.
* Recalculate new structures.
*/ */
Graphic3d_MapIteratorOfMapOfStructure S1Iterator (MyDisplayedStructure); Graphic3d_MapIteratorOfMapOfStructure S1Iterator (MyDisplayedStructure);
Visual3d_TypeOfAnswer Answer; Visual3d_TypeOfAnswer Answer;
@ -3085,11 +3048,7 @@ Graphic3d_SequenceOfStructure FooSequence;
} }
void Visual3d_View::ReCompute (const Handle(Graphic3d_Structure)& AStructure) { void Visual3d_View::ReCompute (const Handle(Graphic3d_Structure)& AStructure) {
#ifdef G003 if (!ComputedMode()) return;
if ( DegenerateModeIsOn () || !ComputedMode () ) return;
#else
if (DegenerateModeIsOn()) return;
#endif // G003
if (IsDeleted ()) return; if (IsDeleted ()) return;
@ -3231,330 +3190,23 @@ Standard_Boolean ComputeShading = ((ViewType == Visual3d_TOV_SHADING) &&
} }
void
#ifdef G003
Visual3d_View::SetAnimationModeOn ( const Standard_Boolean degenerate ) {
#else
Visual3d_View::SetAnimationModeOn () {
#endif
if (AnimationModeIsOn ()) return;
AnimationModeIsActive = Standard_True;
#ifdef G003
if ( degenerate )
SetDegenerateModeOn ();
else
SetDegenerateModeOff ();
#endif // G003
MyGraphicDriver->BeginAnimation (MyCView);
}
void Visual3d_View::SetAnimationModeOff () {
if (! AnimationModeIsOn ()) return;
AnimationModeIsActive = Standard_False;
#ifdef G003
SetDegenerateModeOff ();
#endif // G003
MyGraphicDriver->EndAnimation (MyCView);
}
Standard_Boolean Visual3d_View::AnimationModeIsOn () const {
return AnimationModeIsActive;
}
void Visual3d_View::SetDegenerateModeOn () {
#ifdef TRACE
cout << "Visual3d_View" << MyCView.ViewId
<< "::SetDegenerateModeOn ();\n";
cout << flush;
#endif
// If the degenerated mode is already active, nothing is recalculated
if (DegenerateModeIsOn ()) return;
DegenerateModeIsActive = Standard_True;
#ifdef G003
MyCView.IsDegenerates = 1;
#else
/*
* Change of activity of the degenerated mode
* Remove structures that were calculated
* and displayed when the mode was off.
* Display of non-calculated structures.
*/
Graphic3d_MapIteratorOfMapOfStructure S1Iterator (MyDisplayedStructure);
Visual3d_TypeOfAnswer Answer;
Standard_Integer StructId;
while (S1Iterator.More ()) {
Answer = AcceptDisplay (S1Iterator.Key ());
// If the structure was calculated, the previous one is
// removed and the new one is displayed
// (This is the role of passage into degenerated mode)
if (Answer == Visual3d_TOA_COMPUTE) {
Standard_Integer Index = IsComputed (S1Iterator.Key ());
if (Index != 0) {
StructId =
MyCOMPUTEDSequence.Value (Index)->Identification ();
#ifdef TRACE_COMP
cout << "Structure " << S1Iterator.Key ()->Identification ()
<< " calculated, in the view "
<< Identification () << ", by structure "
<< StructId << " passes in degenerated mode.\n";
cout << "Remove" << StructId << " then display "
<< S1Iterator.Key ()->Identification () << "\n";
cout << flush;
#endif
MyGraphicDriver->EraseStructure
(MyCView, *(Graphic3d_CStructure *)MyCOMPUTEDSequence.Value (Index)->CStructure ());
MyGraphicDriver->DisplayStructure (
MyCView,
*(Graphic3d_CStructure *)S1Iterator.Key ()->CStructure (),
int (S1Iterator.Key ()->DisplayPriority ())
);
}
else {
// Else is impossible)
// If the mode was not degenerated previously, the
// calculated structure associated to S1Iterator.Key ()
// really exists and Index != 0
}
}
// S1Iterator.Next () is located on the next structure
S1Iterator.Next ();
}
#endif //G003
}
void Visual3d_View::SetDegenerateModeOff () {
#ifdef TRACE
cout << "Visual3d_View" << MyCView.ViewId
<< "::SetDegenerateModeOff ();\n";
cout << flush;
#endif
// If the degenerated mode is already inactive, nothing is recalculated
if (! DegenerateModeIsOn ()) return;
DegenerateModeIsActive = Standard_False;
#ifdef G003
MyCView.IsDegenerates = 0;
#else
/*
* Change of activity of degenerated mode
* Remove structures that were displayed
* when the mode was on.
* Calculation of structures.
*/
Graphic3d_MapIteratorOfMapOfStructure S1Iterator (MyDisplayedStructure);
Visual3d_TypeOfAnswer Answer;
Standard_Integer StructId;
Standard_Integer i = MyDisplayedStructure.Extent ();
while (S1Iterator.More ()) {
Answer = AcceptDisplay (S1Iterator.Key ());
// If the structure was calculated, the previous one is
// removed and the new one is displayed
// (This is the role of passage into degenerated mode)
if (Answer == Visual3d_TOA_COMPUTE) {
Standard_Integer Index = IsComputed (S1Iterator.Key ());
if (Index != 0) {
StructId =
MyCOMPUTEDSequence.Value (Index)->Identification ();
#ifdef TRACE_COMP
cout << "Structure " << S1Iterator.Key ()->Identification ()
<< " calculated, in the view "
<< Identification () << ", by the structure "
<< StructId << " passes into normal mode.\n";
cout << "Remove " << S1Iterator.Key ()->Identification ()
<< " then display " << StructId << "\n";
cout << flush;
#endif
MyGraphicDriver->EraseStructure
(MyCView,
*(Graphic3d_CStructure *)S1Iterator.Key ()->CStructure ());
MyGraphicDriver->DisplayStructure (
MyCView,
*(Graphic3d_CStructure *)MyCOMPUTEDSequence.Value (Index)->CStructure (),
int (S1Iterator.Key ()->DisplayPriority ())
);
Display (S1Iterator.Key (), Aspect_TOU_WAIT);
if ((S1Iterator.Key ())->IsHighlighted()) {
if (! (MyCOMPUTEDSequence.Value (Index))->IsHighlighted()) {
(MyCOMPUTEDSequence.Value (Index))->SetHighlightColor
((S1Iterator.Key ())->HighlightColor ());
(MyCOMPUTEDSequence.Value (Index))->GraphicHighlight (Aspect_TOHM_COLOR);
}
}
}
else {
// Else is impossible
// Degenerated mode was activated before display of the
// structure. So the structure was displayed in the
// degenerated mode, but the calculated structure didn't exist.
// It is calculated.
// Compute + Validation
Handle(Graphic3d_Structure) AStructure = (S1Iterator.Key ());
#ifdef OLD
Handle(Graphic3d_Structure) TheStructure = AStructure->Compute (this);
#else
Handle(Graphic3d_Structure) TheStructure;
TColStd_Array2OfReal ATrsf (0, 3, 0, 3);
AStructure->Transform (ATrsf);
if (Index != 0) {
TColStd_Array2OfReal Ident (0, 3, 0, 3);
Standard_Integer ii, jj;
for (ii=0; ii<=3; ii++)
for (jj=0; jj<=3; jj++)
Ident (ii, jj) = (ii == jj ? 1.0 : 0.0);
TheStructure = MyCOMPUTEDSequence.Value (Index);
TheStructure->SetTransform (Ident, Graphic3d_TOC_REPLACE);
if (AStructure->IsTransformed ()) {
AStructure->Compute (this, ATrsf, TheStructure);
}
else {
AStructure->Compute (this, TheStructure);
}
}
else {
if (AStructure->IsTransformed ()) {
TheStructure = AStructure->Compute (this, ATrsf);
}
else {
TheStructure = AStructure->Compute (this);
}
}
#endif
TheStructure->SetHLRValidation (Standard_True);
// Return type of visualisation of the view
Visual3d_TypeOfVisualization ViewType = MyContext.Visualization ();
// Of which type will be the computed ?
Standard_Boolean ComputeWireframe = ((ViewType == Visual3d_TOV_WIREFRAME) &&
((S1Iterator.Key ())->ComputeVisual () != Graphic3d_TOS_SHADING));
Standard_Boolean ComputeShading = ((ViewType == Visual3d_TOV_SHADING) &&
((S1Iterator.Key ())->ComputeVisual () != Graphic3d_TOS_WIREFRAME));
if (ComputeWireframe)
TheStructure->SetVisual (Graphic3d_TOS_WIREFRAME);
if (ComputeShading)
TheStructure->SetVisual (Graphic3d_TOS_SHADING);
if ((S1Iterator.Key ())->IsHighlighted()) {
TheStructure->SetHighlightColor
((S1Iterator.Key ())->HighlightColor ());
TheStructure->GraphicHighlight (Aspect_TOHM_COLOR);
}
// Make range
Standard_Integer Result = 0;
Standard_Integer Length = MyTOCOMPUTESequence.Length ();
// Find structure <S1Iterator.Key ()>
// in the sequence of structures to be calculated
StructId = (S1Iterator.Key ())->Identification ();
for (i=1; i<=Length && Result==0; i++)
if ((MyTOCOMPUTESequence.Value (i))->Identification () ==
StructId) Result = i;
if (Result != 0)
MyCOMPUTEDSequence.ChangeValue (Result) = TheStructure;
else {
// hlhsr and the associated new compute are added
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ()) {
cout << "In Visual3d_View::SetDegenerateModeOff, ";
cout << "TOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
}
#endif
MyTOCOMPUTESequence.Append (S1Iterator.Key ());
MyCOMPUTEDSequence.Append (TheStructure);
#ifdef TRACE_LENGTH
if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
<< " != COMPUTED " << MyCOMPUTEDSequence.Length ()
<< "\n" << flush;
#endif
}
// The degenerated is removed and the calculated is displayed
MyGraphicDriver->EraseStructure
(MyCView,
*(Graphic3d_CStructure *)(S1Iterator.Key ()->CStructure ()));
MyGraphicDriver->DisplayStructure (
MyCView,
*(Graphic3d_CStructure *)TheStructure->CStructure (),
int (S1Iterator.Key ()->DisplayPriority ())
);
}
}
// S1Iterator.Next () is located on the next structure
S1Iterator.Next ();
}
if (MyViewManager->UpdateMode () == Aspect_TOU_ASAP) Update ();
#endif //G003
}
Standard_Boolean Visual3d_View::DegenerateModeIsOn () const {
return DegenerateModeIsActive;
}
const Handle(Graphic3d_GraphicDriver)& Visual3d_View::GraphicDriver () const { const Handle(Graphic3d_GraphicDriver)& Visual3d_View::GraphicDriver () const {
return MyGraphicDriver; return MyGraphicDriver;
} }
void Visual3d_View::Plot (const Handle(Graphic3d_Plotter)& APlotter) const { void Visual3d_View::Plot (const Handle(Graphic3d_Plotter)& thePlotter) const
{
Graphic3d_MapIteratorOfMapOfStructure S1Iterator (MyDisplayedStructure); for (Graphic3d_MapIteratorOfMapOfStructure S1Iterator (MyDisplayedStructure); S1Iterator.More(); S1Iterator.Next())
{
while (S1Iterator.More ()) { Standard_Integer Index = IsComputed (S1Iterator.Key ());
// displayed structure is plotted as if it was not calculated
if (DegenerateModeIsOn ()) if (Index == 0)
// As the mode is degenerated the displayed structure (S1Iterator.Key ())->Plot (thePlotter);
// is plotted without taking into account if it is calculated or not else
(S1Iterator.Key ())->Plot (APlotter); (MyCOMPUTEDSequence.Value (Index))->Plot (thePlotter);
else { }
Standard_Integer Index = IsComputed (S1Iterator.Key ());
// As the mode is not degenerated the displayed structure
// is plotted as if it was not calculated, otherwise the
// associated calculated structure is plotted.
if (Index == 0)
(S1Iterator.Key ())->Plot (APlotter);
else
(MyCOMPUTEDSequence.Value (Index))->Plot (APlotter);
}
// S1Iterator.Next () is located on the next structure
S1Iterator.Next ();
}
} }
Standard_Integer Visual3d_View::HaveTheSameOwner (const Handle(Graphic3d_Structure)& AStructure) const { Standard_Integer Visual3d_View::HaveTheSameOwner (const Handle(Graphic3d_Structure)& AStructure) const {
@ -3924,13 +3576,13 @@ Handle(Visual3d_ViewManager) Visual3d_View::ViewManager() const
return MyPtrViewManager; return MyPtrViewManager;
} }
#ifdef G003 void Visual3d_View :: SetComputedMode ( const Standard_Boolean aMode )
void Visual3d_View :: SetComputedMode ( const Standard_Boolean aMode ) { {
if ((aMode && ComputedModeIsActive) ||
if ( ( (aMode && ComputedModeIsActive) || (!aMode && !ComputedModeIsActive))
(!aMode && !ComputedModeIsActive) {
) || DegenerateModeIsOn () return;
) return; }
Graphic3d_MapIteratorOfMapOfStructure S1Iterator ( MyDisplayedStructure ); Graphic3d_MapIteratorOfMapOfStructure S1Iterator ( MyDisplayedStructure );
Visual3d_TypeOfAnswer Answer; Visual3d_TypeOfAnswer Answer;
@ -4175,7 +3827,6 @@ Visual3d_TypeOfBackfacingModel Visual3d_View :: BackFacingModel () const {
return Visual3d_TOBM_DISABLE; return Visual3d_TOBM_DISABLE;
} // end Visual3d_View :: BackFacingModel } // end Visual3d_View :: BackFacingModel
#endif // G003
void Visual3d_View::EnableDepthTest( const Standard_Boolean enable ) const void Visual3d_View::EnableDepthTest( const Standard_Boolean enable ) const
{ {

View File

@ -16,12 +16,9 @@
// purpose or non-infringement. Please see the License for the specific terms // purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License. // and conditions governing the rights and limitations under the License.
#ifndef VIEW_PXX_INCLUDED #ifndef VIEW_PXX_INCLUDED
#define VIEW_PXX_INCLUDED #define VIEW_PXX_INCLUDED
#define G003 // EUG Manage computed mode activation flag
// views identifiers : possible range // views identifiers : possible range
#define View_IDMIN 1 #define View_IDMIN 1
#define View_IDMAX 10000 #define View_IDMAX 10000
@ -30,8 +27,6 @@
#define MyMatOfMapIsEvaluated MyCBitFields.bool1 #define MyMatOfMapIsEvaluated MyCBitFields.bool1
#define MyMatOfOriIsEvaluated MyCBitFields.bool2 #define MyMatOfOriIsEvaluated MyCBitFields.bool2
#define DegenerateModeIsActive MyCBitFields.bool3
#define AnimationModeIsActive MyCBitFields.bool4
#define IsInitialized MyCBitFields.bool5 #define IsInitialized MyCBitFields.bool5
#define ComputedModeIsActive MyCBitFields.bool6 #define ComputedModeIsActive MyCBitFields.bool6

View File

@ -1,20 +0,0 @@
puts "========"
puts "BUC60753"
puts "========"
puts ""
restore [locate_data_file buc60753.brep] a
checkshape a
tclean a
vinit
vdisplay a
vsetdispmode a 1
vfit
set TypeOfDegenerateModel 2
set Ratio 0.5
BUC60753 ${TypeOfDegenerateModel} ${Ratio}
set only_screen 1