mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0024720: Some standard samples are not compiled after latest integration to visualisation
Fixed compilation errors in samples: mfc/standard qt/Tutorial qt/IESample
This commit is contained in:
@@ -69,6 +69,7 @@ Convert_Presentation::Convert_Presentation()
|
||||
myIndex = 0;
|
||||
myNbFuncs = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
|
||||
myNbSamples = myNbFuncs;
|
||||
FitMode = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -84,7 +85,6 @@ void Convert_Presentation::DoSample()
|
||||
(this->*SampleFuncs[myIndex])();
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
|
||||
// Purpose :
|
||||
@@ -332,7 +332,7 @@ void Convert_Presentation::sampleRevolSurface()
|
||||
{
|
||||
FitMode=false;
|
||||
ResetView();
|
||||
SetViewCenter(176.84682,102.12892);
|
||||
TranslateView(-176.84682, -102.12892);
|
||||
SetViewScale(0.69326);
|
||||
|
||||
getAISContext()->EraseAll();
|
||||
|
@@ -257,20 +257,20 @@ Handle_AIS_Shape OCCDemo_Presentation::drawShape
|
||||
return aGraphicShape;
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc)
|
||||
void OCCDemo_Presentation::GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->GetViewCenter(Xc,Yc);
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->GetViewAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc)
|
||||
void OCCDemo_Presentation::SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewCenter(Xc,Yc);
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z)
|
||||
@@ -311,4 +311,12 @@ void OCCDemo_Presentation::ResetView()
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::TranslateView (const V3d_Coordinate theX, const V3d_Coordinate theY)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->Translate (theX, theY);
|
||||
}
|
||||
|
@@ -50,14 +50,14 @@ public:
|
||||
void NextSample() {myIndex++;}
|
||||
void PrevSample() {myIndex--;}
|
||||
virtual void DoSample() = 0;
|
||||
static void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
|
||||
static void SetViewCenter(const V3d_Coordinate Xc, const V3d_Coordinate Yc);
|
||||
static void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
static void SetViewEye(V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z);
|
||||
static void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ);
|
||||
static void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ);
|
||||
static void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
static void SetViewEye (V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z);
|
||||
static Quantity_Factor GetViewScale();
|
||||
static void SetViewScale(Quantity_Factor Coef);
|
||||
static void ResetView();
|
||||
|
||||
static void TranslateView (const V3d_Coordinate theX, const V3d_Coordinate theY);
|
||||
|
||||
// place one-time initialization code in this function
|
||||
virtual void Init() {}
|
||||
|
@@ -97,6 +97,8 @@ void COCCDemoView::OnInitialUpdate()
|
||||
CView::OnInitialUpdate();
|
||||
|
||||
myView = GetDocument()->GetViewer()->CreateView();
|
||||
myView->SetViewMappingDefault();
|
||||
myView->SetViewOrientationDefault();
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ());
|
||||
myView->SetWindow(aWNTWindow);
|
||||
@@ -543,14 +545,14 @@ void COCCDemoView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
|
||||
pCmdUI->Enable (myVisMode != VIS_HLR);
|
||||
}
|
||||
|
||||
void COCCDemoView::GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc)
|
||||
void COCCDemoView::GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const
|
||||
{
|
||||
myView->Center(Xc,Yc);
|
||||
myView->At (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void COCCDemoView::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc)
|
||||
void COCCDemoView::SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ)
|
||||
{
|
||||
myView->SetCenter(Xc,Yc);
|
||||
myView->SetAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void COCCDemoView::GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z)
|
||||
@@ -572,3 +574,8 @@ void COCCDemoView::SetViewScale(Quantity_Factor Coef)
|
||||
{
|
||||
myView->SetScale(Coef);
|
||||
}
|
||||
|
||||
void COCCDemoView::Translate (const Standard_Real theX, const Standard_Real theY)
|
||||
{
|
||||
myView->Panning (theX, theY);
|
||||
}
|
||||
|
@@ -27,13 +27,18 @@ protected: // create from serialization only
|
||||
// Attributes
|
||||
public:
|
||||
COCCDemoDoc* GetDocument();
|
||||
void FitAll() { myView->FitAll(); myView->ZFitAll(); };
|
||||
void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
|
||||
void SetViewCenter(const V3d_Coordinate Xc, const V3d_Coordinate Yc);
|
||||
void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
void SetViewEye(const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
|
||||
void FitAll()
|
||||
{
|
||||
myView->FitAll();
|
||||
myView->ZFitAll();
|
||||
};
|
||||
void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const;
|
||||
void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ);
|
||||
void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
void SetViewEye (const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
|
||||
Quantity_Factor GetViewScale();
|
||||
void SetViewScale(const Quantity_Factor Coef);
|
||||
void Translate (const V3d_Coordinate theX, const V3d_Coordinate theY);
|
||||
|
||||
|
||||
// Operations
|
||||
|
Reference in New Issue
Block a user