-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "OCCViewer_ViewManager.h"
#include "OCCViewer_ClipPlaneInteractor.h"
-#include <Basics_OCCTVersion.hxx>
-
#include <V3d_View.hxx>
-#include <Visual3d_View.hxx>
#include <Geom_Plane.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
-#if OCC_VERSION_LARGE > 0x06080000
- #include <Prs3d_Drawer.hxx>
-#else
- #include <AIS_Drawer.hxx>
-#endif
+#include <Prs3d_Drawer.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
if ( !aPrs->IsEmpty() && !aPrs->IsInfinite() ) {
isFound = true;
double xmin, ymin, zmin, xmax, ymax, zmax;
-#if OCC_VERSION_LARGE > 0x06070100
Bnd_Box aBox = aPrs->MinMaxValues();
xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
xmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X();
ymax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y();
zmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z();
-#else
- aPrs->MinMaxValues( xmin, ymin, zmin, xmax, ymax, zmax );
-#endif
aXMin = qMin( aXMin, xmin ); aXMax = qMax( aXMax, xmax );
aYMin = qMin( aYMin, ymin ); aYMax = qMax( aYMax, ymax );
aZMin = qMin( aZMin, zmin ); aZMax = qMax( aZMax, zmax );
QFont fnt = SpinSliderDistance->font(); fnt.setBold( true ); SpinSliderDistance->setFont( fnt );
GroupParametersLayout->addWidget( SpinSliderDistance, 1, 1 );
- QString aUnitRot = "\xB0";
+ QString aUnitRot = QString(QChar(0xB0));
TextLabelRotation1 = new QLabel( tr("ROTATION_AROUND_X_Y2Z"), GroupParameters );
TextLabelRotation1->setObjectName( "TextLabelRotation1" );
OCCViewer_ViewManager* aViewMgr = (OCCViewer_ViewManager*) myModel->getViewManager();
myInteractor = new OCCViewer_ClipPlaneInteractor( aViewMgr, this );
- connect( myInteractor, SIGNAL( planeClicked( const Handle_AIS_Plane& ) ), SLOT( onPlaneClicked( const Handle_AIS_Plane& ) ) );
- connect( myInteractor, SIGNAL( planeDragged( const Handle_AIS_Plane& ) ), SLOT( onPlaneDragged( const Handle_AIS_Plane& ) ) );
+ connect( myInteractor, SIGNAL( planeClicked( const Handle_AIS_Plane& ) ),
+ SLOT( onPlaneClicked( const Handle_AIS_Plane& ) ) );
+ connect( myInteractor, SIGNAL( planeDragged( const Handle_AIS_Plane& ) ),
+ SLOT( onPlaneDragged( const Handle_AIS_Plane& ) ) );
myLocalPlanes = myModel->getClipPlanes();
synchronize();
void OCCViewer_ClippingDlg::synchronize()
{
ComboBoxPlanes->clear();
- int aNbPlanesAbsolute = myLocalPlanes.size();
+ int aNbPlanesAbsolute = (int)myLocalPlanes.size();
QString aName;
for(int i = 1; i<=aNbPlanesAbsolute; i++ ) {
gp_Pnt aBasePnt;
gp_Dir aNormal;
clipPlaneParams(aClipPlane, ic, aSize, aBasePnt, aNormal, myModel->trihedronSize());
- if(myPreviewPlaneVector.size() < clipPlanesCount()) {
+ if((int)myPreviewPlaneVector.size() < clipPlanesCount()) { //TODO: mismatch signed/unsigned
myPreviewPlaneVector.resize(clipPlanesCount());
}
myPreviewPlane = myPreviewPlaneVector[aCurPlaneIndex];
ic->SetColor( myPreviewPlane, Quantity_Color( 255. / 255., 70. / 255., 0. / 255., Quantity_TOC_RGB ), false );
ic->Update( myPreviewPlane, Standard_False );
} else {
- if(myPreviewPlaneVector.size() > aCurPlaneIndex ) {
+ if((int)myPreviewPlaneVector.size() > aCurPlaneIndex ) {
myPreviewPlane = myPreviewPlaneVector[aCurPlaneIndex];
if(ic->IsDisplayed(myPreviewPlane)) {
ic->Erase( myPreviewPlane, false );
myPreviewPlaneVector[aCurPlaneIndex].Nullify();
}
}
- for(int i = 0; i < myPreviewPlaneVector.size(); i++) {
+ for(int i = 0; i < (int)myPreviewPlaneVector.size(); i++) {//TODO: mismatch signed/unsigned
if( i == aCurPlaneIndex ) continue;
if(!myPreviewPlaneVector[i].IsNull())
ic->SetColor( myPreviewPlaneVector[i], Quantity_Color( 85 / 255., 85 / 255., 255 / 255., Quantity_TOC_RGB ), false );
Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
- for ( int i=0; i < myPreviewPlaneVector.size(); i++ ) {
+ for ( int i=0; i < (int)myPreviewPlaneVector.size(); i++ ) {//TODO: mismatch signed/unsigned
Handle(AIS_Plane) myPreviewPlane = myPreviewPlaneVector[i];
if ( !myPreviewPlane.IsNull() && ic->IsDisplayed( myPreviewPlane ) ) {
ic->Erase( myPreviewPlane, false );
Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
- if(aPlaneIndex+1 <= myPreviewPlaneVector.size()) {
+ if(aPlaneIndex+1 <= (int)myPreviewPlaneVector.size()) {
Handle(AIS_Plane) myPreviewPlane = myPreviewPlaneVector[aPlaneIndex];
if ( !myPreviewPlane.IsNull() && ic->IsDisplayed( myPreviewPlane ) ) {
ic->Erase( myPreviewPlane, false );
{
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if ( app )
- app->onHelpContextModule( "GUI", "occ_3d_viewer_page.html", "clipping_planes" );
+ app->onHelpContextModule( "GUI", "occ_3d_viewer.html", "clipping-planes" );
}
/*!
return;
}
- OCCViewer_ClipPlane& aClipPlane = getClipPlane( theIndex );
+ //OCCViewer_ClipPlane& aClipPlane = getClipPlane( theIndex ); // unused
myIsSelectPlane = true;
updateControls();
/*!
SLOT: Called when clip plane is clicked in viewer.
*/
-void OCCViewer_ClippingDlg::onPlaneClicked( const Handle(AIS_Plane)& thePlane )
+void OCCViewer_ClippingDlg::onPlaneClicked( const Handle_AIS_Plane& thePlane )
{
- for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ )
+ for ( int aPlaneIt = 0; aPlaneIt < (int)myPreviewPlaneVector.size(); aPlaneIt++ )
{
Handle(AIS_Plane)& aPlane = myPreviewPlaneVector.at( aPlaneIt );
if ( aPlane != thePlane )
/*!
SLOT: Called when clip plane is changed by dragging in viewer.
*/
-void OCCViewer_ClippingDlg::onPlaneDragged( const Handle(AIS_Plane)& thePlane )
+void OCCViewer_ClippingDlg::onPlaneDragged( const Handle_AIS_Plane& thePlane )
{
- for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ )
+ for ( int aPlaneIt = 0; aPlaneIt < (int)myPreviewPlaneVector.size(); aPlaneIt++ )
{
Handle(AIS_Plane)& aPlane = myPreviewPlaneVector.at( aPlaneIt );
if ( aPlane != thePlane )