// - color for edges in shading+edges mode
AISShape->SetEdgesInShadingColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
-
- // ???
- AISShape->storeBoundaryColors();
// set display mode
AISShape->SetDisplayMode( HasDisplayMode() ?
// display mode from properties
propMap.value( GEOM::propertyName( GEOM::DisplayMode ) ).toInt() );
+ // - face boundaries color
+ if( AISShape->DisplayMode() == GEOM_AISShape::ShadingWithEdges )
+ AISShape->Attributes()->SetFaceBoundaryDraw( Standard_True );
+ anAspect = AISShape->Attributes()->FaceBoundaryAspect();
+ anAspect->SetColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
+ AISShape->Attributes()->SetFaceBoundaryAspect( anAspect );
+
// set display vectors flag
AISShape->SetDisplayVectors( propMap.value( GEOM::propertyName( GEOM::EdgesDirection ) ).toBool() );
myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
myPrevDisplayMode = 0;
- storeBoundaryColors();
-
myEdgesInShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
- myUIsoNumber = -1;
- myVIsoNumber = -1;
-
myTopLevel = Standard_False;
Graphic3d_MaterialAspect aMatAspect;
if ( !HasMaterial() ) {
case 0://StdSelect_DM_Wireframe:
case CustomHighlight:
{
- restoreIsoNumbers();
- // Restore wireframe edges colors
- restoreBoundaryColors();
if(isTopLev) {
SetColor(topLevelColor());
Handle(Prs3d_LineAspect) anAspect = Attributes()->WireAspect();
}
case 1://StdSelect_DM_Shading:
{
- restoreIsoNumbers();
shadingMode(aPresentationManager, aPrs, aMode);
- // Store wireframe edges colors
- storeBoundaryColors();
+ break;
+ }
+ case 2: { //ShadingWithEdges
+ //Shaded faces
+ shadingMode(aPresentationManager, aPrs, AIS_Shaded);
+ myDrawer->SetFaceBoundaryDraw( Standard_True );
+ Handle(Prs3d_LineAspect) aBoundaryAspect =
+ new Prs3d_LineAspect ( myEdgesInShadingColor, Aspect_TOL_SOLID, myOwnWidth );
+ myDrawer->SetFaceBoundaryAspect (aBoundaryAspect);
break;
}
case 3: //StdSelect_DM_HLR:
break;
}
}
-
- if ( aMode == ShadingWithEdges ) {
- // Temporary store number of iso lines in order to recover its later
- // when display mode is achnged to 'Wirefame' or 'Shading'.
- // Iso lines are not displayed in 'Shading with edges' mode.
- storeIsoNumbers();
-
- // Reset number of iso lines to 0
- resetIsoNumbers();
-
- //Shaded faces
- shadingMode(aPresentationManager, aPrs, AIS_Shaded);
-
- // Store wireframe edges colors
- storeBoundaryColors();
-
- // Coloring edges
- Handle(Prs3d_LineAspect) anAspect = myDrawer->UnFreeBoundaryAspect();
- anAspect->SetColor( myEdgesInShadingColor );
- myDrawer->SetUnFreeBoundaryAspect( anAspect );
-
- anAspect = myDrawer->FreeBoundaryAspect();
- anAspect->SetColor( myEdgesInShadingColor );
- myDrawer->SetFreeBoundaryAspect( anAspect );
-
- // Add edges to presentation
- if( anIsColorField && myFieldDimension == 1 )
- drawField( aPrs );
- else
- StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
- }
-
if (isShowVectors())
{
const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
}
}
-void GEOM_AISShape::storeIsoNumbers()
-{
- myUIsoNumber = myDrawer->UIsoAspect()->Number();
- myVIsoNumber = myDrawer->VIsoAspect()->Number();
-}
-
-void GEOM_AISShape::restoreIsoNumbers()
-{
- if ( myUIsoNumber > 0 ) {
- // Restore number of U iso lines
- Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect();
- anAspect->SetNumber( myUIsoNumber );
- myDrawer->SetUIsoAspect( anAspect );
- }
-
- if ( myVIsoNumber > 0 ) {
- // Restore number of V iso lines
- Handle(Prs3d_IsoAspect) anAspect = myDrawer->VIsoAspect();
- anAspect->SetNumber( myVIsoNumber );
- myDrawer->SetVIsoAspect( anAspect );
- }
-}
-
-void GEOM_AISShape::resetIsoNumbers()
-{
- Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect();
- anAspect->SetNumber( 0 );
- myDrawer->SetUIsoAspect( anAspect );
-
- anAspect = myDrawer->VIsoAspect();
- anAspect->SetNumber( 0 );
- myDrawer->SetVIsoAspect( anAspect );
-}
-
-void GEOM_AISShape::storeBoundaryColors()
-{
- Aspect_TypeOfLine aLT;
- Standard_Real aW;
-
- myDrawer->FreeBoundaryAspect()->Aspect()->Values( myFreeBoundaryColor, aLT, aW);
- myDrawer->UnFreeBoundaryAspect()->Aspect()->Values( myUnFreeBoundaryColor, aLT, aW);
-}
-
-void GEOM_AISShape::restoreBoundaryColors()
-{
- Handle(Prs3d_LineAspect) anAspect = myDrawer->FreeBoundaryAspect();
- anAspect->SetColor( myFreeBoundaryColor );
- myDrawer->SetFreeBoundaryAspect( anAspect );
-
- anAspect = myDrawer->UnFreeBoundaryAspect();
- anAspect->SetColor( myUnFreeBoundaryColor );
- myDrawer->SetUnFreeBoundaryAspect( anAspect );
-}
-
-
Standard_Boolean GEOM_AISShape::isTopLevel() {
return myTopLevel;
}
const Handle(Standard_Type)& DynamicType() const;
Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
- void storeIsoNumbers();
- void restoreIsoNumbers();
- void resetIsoNumbers();
-
- void storeBoundaryColors();
-
static Quantity_Color topLevelColor();
static void setTopLevelColor(const Quantity_Color c);
const Handle(Prs3d_Presentation)& aPrs,
const Standard_Integer aMode);
- void restoreBoundaryColors();
-
// Displaying the field data
void drawField( const Handle(Prs3d_Presentation)& thePrs,
const bool theIsText = false,
gp_Pnt& theCenter );
Quantity_Color myShadingColor;
-
- Quantity_Color myFreeBoundaryColor;
- Quantity_Color myUnFreeBoundaryColor;
-
Quantity_Color myEdgesInShadingColor;
- int myUIsoNumber;
- int myVIsoNumber;
-
private:
TCollection_AsciiString myName;
bool myDisplayVectors;
myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer());
- myNbIsos[0] = -1;
- myNbIsos[1] = -1;
-
// Toggle display mode
setDisplayMode(0); // WIRE FRAME
SetVectorMode(0); //
#ifdef MYDEBUG
MESSAGE ( "GEOM_Actor::setDisplayMode = "<<theMode );
#endif
-
- if ( theMode == (int)eShading || theMode == (int)eShadingWithEdges ) {
- // Temporary store number of iso lines in order to recover its later
- // when display mode is changed to 'Wirefame'
- // Iso lines are not displayed in 'Shading' and 'Shading with edges' modes.
- StoreIsoNumbers();
-
- // Reset number of iso lines to 0
- ResetIsoNumbers();
- }
if ( theMode == (int)eShadingWithEdges ) {
// Coloring edges
myEdgesInShadingColor[2]);
}
else {
- // Restore number of iso-lines
- RestoreIsoNumbers();
-
// Coloring edges
myIsolatedEdgeActor->GetProperty()->SetColor(myIsolatedEdgeColor[0],
myIsolatedEdgeColor[1],
MESSAGE ( this << " GEOM_Actor::Highlight myIsSelected="<<myIsSelected );
#endif
- if ( myDisplayMode == (int)eShading || myDisplayMode == (int)eShadingWithEdges ) {
- if ( theIsHighlight )
- RestoreIsoNumbers();
- else
- // Reset number of iso lines to 0
- ResetIsoNumbers();
- }
-
SALOME_Actor::Highlight(theIsHighlight); // this method call ::highlight(theIsHighlight) in the end
SetVisibility(GetVisibility());
}
if ( !GetPickable() )
return false;
- if ( myDisplayMode == (int)eShading || myDisplayMode == (int)eShadingWithEdges ) {
- if ( theIsHighlight )
- RestoreIsoNumbers();
- else
- // Reset number of iso lines to 0
- ResetIsoNumbers();
- }
-
myPreHighlightActor->SetVisibility( false );
bool anIsPreselected = myIsPreselected;
myEdgesInShadingColor[2] = b;
}
-void GEOM_Actor::StoreIsoNumbers()
-{
- myWireframeFaceSource->GetNbIso(myNbIsos[0], myNbIsos[1]);
-}
-
void GEOM_Actor::SetIsosWidth(const int width) {
myWireframeFaceActor->GetProperty()->SetLineWidth(width);
}
int GEOM_Actor::GetWidth() const {
return (int)myIsolatedEdgeActor->GetProperty()->GetLineWidth();
}
-
-void GEOM_Actor::RestoreIsoNumbers()
-{
- if ( myNbIsos[0] > 0 || myNbIsos[1] > 0 )
- // Restore number of U and (or) V iso lines
- myWireframeFaceSource->SetNbIso(myNbIsos);
-}
-
-void GEOM_Actor::ResetIsoNumbers()
-{
- int aNb[2] = {0, 0};
- myWireframeFaceSource->SetNbIso(aNb);
-}