X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_Actor.cxx;h=44d2747b755ff2c0893e03823e9e1efc112435d6;hp=1cc7927bfba0b9990b80a33dc65dbc72e4fa3ffe;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=665d037f93371114bf4b00bf11b0f95be418fb77 diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 1cc7927bf..44d2747b7 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 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 @@ -139,8 +139,8 @@ SMESH_ActorDef::SMESH_ActorDef() myIsFacesOriented = false; - int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement(); - int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); + float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement(); + float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement(); myControlsPrecision = -1; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -148,11 +148,11 @@ SMESH_ActorDef::SMESH_ActorDef() if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1); - double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5); - double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10); - double aBallElemScale = SMESH::GetFloat("SMESH:ball_elem_scale",1.0); - double aLineWidth = SMESH::GetFloat("SMESH:element_width",1); - double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1); + float aElem0DSize = (float) SMESH::GetFloat("SMESH:elem0d_size",5); + float aBallElemSize = (float) SMESH::GetFloat("SMESH:ball_elem_size",10); + float aBallElemScale = (float) SMESH::GetFloat("SMESH:ball_elem_scale",1.0); + float aLineWidth = (float) SMESH::GetFloat("SMESH:element_width",1); + float aOutlineWidth = (float) SMESH::GetFloat("SMESH:outline_width",1); SMESH::LabelFont aFamilyNd = SMESH::FntTimes; bool aBoldNd = true; @@ -1035,7 +1035,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode ) return; } - int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0; + smIdType aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0; bool aShowOnlyScalarBarTitle = false; if(aNbCells) { //myControlMode = theMode; @@ -1135,7 +1135,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode ) //Update(); } -int SMESH_ActorDef::GetNumberControlEntities() +smIdType SMESH_ActorDef::GetNumberControlEntities() { SMESH_DeviceActor* anAct = NULL; switch(myControlMode){ @@ -1161,7 +1161,7 @@ int SMESH_ActorDef::GetNumberControlEntities() break; default:; } - return (anAct) ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1; + return anAct ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1; } void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer) @@ -1453,27 +1453,27 @@ void SMESH_ActorDef::UnShrink() } -int SMESH_ActorDef::GetNodeObjId(int theVtkID) +vtkIdType SMESH_ActorDef::GetNodeObjId(vtkIdType theVtkID) { return myPickableActor->GetNodeObjId(theVtkID); } -double* SMESH_ActorDef::GetNodeCoord(int theObjID) +double* SMESH_ActorDef::GetNodeCoord(vtkIdType theObjID) { return myPickableActor->GetNodeCoord(theObjID); } -int SMESH_ActorDef::GetNodeVtkId(int theObjID) +vtkIdType SMESH_ActorDef::GetNodeVtkId(vtkIdType theObjID) { return myPickableActor->GetNodeVtkId(theObjID); } -int SMESH_ActorDef::GetElemObjId(int theVtkID) +vtkIdType SMESH_ActorDef::GetElemObjId(vtkIdType theVtkID) { return myPickableActor->GetElemObjId(theVtkID); } -vtkCell* SMESH_ActorDef::GetElemCell(int theObjID) +vtkCell* SMESH_ActorDef::GetElemCell(vtkIdType theObjID) { return myPickableActor->GetElemCell(theObjID); } @@ -1643,7 +1643,8 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode) theMode |= eVolumes; } - myBaseActor->myGeomFilter->SetInside(myEntityMode != anObjectEntities); + // rnv : Fix volume selection on Display Entity + //myBaseActor->myGeomFilter->SetInside(myEntityMode != anObjectEntities); if ( anObjectEntities == 0 && myRepresentation != ePoint ) // no elements, show nodes { @@ -1664,11 +1665,11 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode) void SMESH_ActorDef::SetRepresentation (int theMode) { - int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); - int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); - int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume); - int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); - int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); + smIdType aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); + smIdType aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); + smIdType aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume); + smIdType aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); + smIdType aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls ) { @@ -1713,7 +1714,7 @@ void SMESH_ActorDef::SetRepresentation (int theMode) myPickableActor = myBaseActor; vtkProperty *aProp = NULL, *aBackProp = NULL; vtkProperty *aPropVN = NULL, *aPropVR = NULL; - SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1); + SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::eNoneRepr; SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation(); switch (myRepresentation) { case ePoint: @@ -2125,8 +2126,8 @@ void SMESH_ActorDef::UpdateSelectionProps() { QColor selectionColor = SMESH_ActorProps::props()->selectionColor(); QColor highlightColor = SMESH_ActorProps::props()->highlightColor(); - int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); - double width = GetLineWidth(); + float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement(); + float width = (float) GetLineWidth(); myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF()); myHighlightProp->SetLineWidth(width + selectionIncrement); myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF()); @@ -2142,17 +2143,17 @@ double SMESH_ActorDef::GetLineWidth() void SMESH_ActorDef::SetLineWidth(double theVal) { - int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement(); - int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); + float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement(); + float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement(); - myEdgeProp->SetLineWidth(theVal); + myEdgeProp->SetLineWidth((float) theVal); - my1DProp->SetLineWidth(theVal + controlsIncrement); - my1DExtProp->SetLineWidth(theVal + controlsIncrement); - my2DExtProp->SetLineWidth(theVal + controlsIncrement); - my3DExtProp->SetLineWidth(theVal + controlsIncrement); - myHighlightProp->SetLineWidth(theVal + selectionIncrement); - myPreselectProp->SetLineWidth(theVal + selectionIncrement); + my1DProp ->SetLineWidth((float) theVal + controlsIncrement); + my1DExtProp ->SetLineWidth((float) theVal + controlsIncrement); + my2DExtProp ->SetLineWidth((float) theVal + controlsIncrement); + my3DExtProp ->SetLineWidth((float) theVal + controlsIncrement); + myHighlightProp->SetLineWidth((float) theVal + selectionIncrement); + myPreselectProp->SetLineWidth((float) theVal + selectionIncrement); Modified(); } @@ -2163,21 +2164,21 @@ double SMESH_ActorDef::GetOutlineWidth() void SMESH_ActorDef::SetOutlineWidth(double theVal) { - myOutLineProp->SetLineWidth(theVal); + myOutLineProp->SetLineWidth((float) theVal); Modified(); } void SMESH_ActorDef::Set0DSize(double theVal) { - my0DProp->SetPointSize(theVal); - myHighlightProp->SetPointSize(theVal); - myPreselectProp->SetPointSize(theVal); + my0DProp ->SetPointSize((float) theVal); + myHighlightProp->SetPointSize((float) theVal); + myPreselectProp->SetPointSize((float) theVal); if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) { - aCustom->Set0DSize(theVal); + aCustom->Set0DSize((float) theVal); } if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) { - aCustom->Set0DSize(theVal); + aCustom->Set0DSize((float) theVal); } Modified(); @@ -2190,13 +2191,13 @@ double SMESH_ActorDef::Get0DSize() void SMESH_ActorDef::SetBallSize(double theVal) { - myBallProp->SetPointSize(theVal); + myBallProp->SetPointSize((float) theVal); if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) { - aCustom->SetBallSize(theVal); + aCustom->SetBallSize((float) theVal); } if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) { - aCustom->SetBallSize(theVal); + aCustom->SetBallSize((float) theVal); } Modified(); @@ -2225,7 +2226,7 @@ void SMESH_ActorDef::SetBallScale( double theVal ) Modified(); } -int SMESH_ActorDef::GetObjDimension( const int theObjId ) +int SMESH_ActorDef::GetObjDimension( const vtkIdType theObjId ) { return myVisualObj->GetElemDimension( theObjId ); } @@ -2495,7 +2496,7 @@ void SMESH_ActorDef::UpdateDistribution() SMESH_VisualObjDef::TEntityList elems; if ( dynamic_cast(myVisualObj.get())) dynamic_cast(myVisualObj.get())->GetEntities( fun->GetType(), elems ); - std::vector elemIds; elemIds.reserve( elems.size() ); + std::vector elemIds; elemIds.reserve( elems.size() ); for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) elemIds.push_back( (*e)->GetID()); vtkLookupTable* lookupTable = static_cast(myScalarBarActor->GetLookupTable()); @@ -2681,7 +2682,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() SMESH_VisualObjDef::TEntityList elems; if ( dynamic_cast(myVisualObj.get())) dynamic_cast(myVisualObj.get())->GetEntities( fun->GetType(), elems ); - std::vector elemIds; + std::vector elemIds; for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) elemIds.push_back( (*e)->GetID());