*/
GaussMetric GetGaussMetric();
+ /*!
+ * Sets the color of mesh links.
+ * \param theColor The color of the links. This parameter is taken from <VAR>Color</VAR> enumeration.
+ */
+ void SetLinkColor(in SALOMEDS::Color theColor);
+
+ /*!
+ * Gets the color of mesh links.
+ */
+ SALOMEDS::Color GetLinkColor();
};
//-------------------------------------------------------
<parameter name="show_manifold_edges" value="false"/>
<parameter name="show_non_manifold_edges" value="false"/>
<parameter name="feature_edges_coloring" value="false"/>
+ <parameter name="edge_color" value="255, 255, 255"/>
<parameter name="scalar_bar_horizontal_height" value="0.08"/>
<parameter name="scalar_bar_horizontal_width" value="0.8" />
<parameter name="scalar_bar_horizontal_x" value="0.1"/>
myEdgeActor->SetTransform(theTransform);
}
+//----------------------------------------------------------------------------
+vtkProperty*
+VISU_ScalarMapAct
+::GetEdgeProperty()
+{
+ return myEdgeActor->GetProperty();
+}
+
//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
SetBarVisibility(anActor->GetBarVisibility());
myPointsActor->DeepCopy( anActor->myPointsActor );
SetShading(anActor->IsShading());
+ GetEdgeProperty()->DeepCopy(anActor->GetEdgeProperty());
}
}
void
SetTransform(VTKViewer_Transform* theTransform);
+ virtual
+ vtkProperty*
+ GetEdgeProperty();
+
virtual
void
SetShrinkable(bool theIsShrinkable);
<source>VISU_DISP_ONLY</source>
<translation>Display only on creation</translation>
</message>
+ <message>
+ <source>VISU_EDGE_COLOR</source>
+ <translation>Edge Color</translation>
+ </message>
<message>
<source>VISU_FEATURE_EDGES</source>
<translation>Feature edges</translation>
return;
VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
- if(!aMesh)
+ VISU::ScalarMap_i* aScalarMap = dynamic_cast<VISU::ScalarMap_i*>(aPrs3d);
+ if(!aMesh && !aScalarMap)
return;
- SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor;
+ SALOMEDS::Color anOldColor, aNewColor;
+ if (aMesh)
+ anOldColor = aMesh->GetLinkColor();
+ else if (aScalarMap)
+ anOldColor = aScalarMap->GetLinkColor();
+
+
QColor aColor (int(255*anOldColor.R),
int(255*anOldColor.G),
int(255*anOldColor.B));
aNewColor.R = aColorNew.red()/255.;
aNewColor.G = aColorNew.green()/255.;
aNewColor.B = aColorNew.blue()/255.;
- aMesh->SetLinkColor(aNewColor);
- RecreateActor(this, aMesh);
+ if (aMesh)
+ aMesh->SetLinkColor(aNewColor);
+ else
+ aScalarMap->SetLinkColor(aNewColor);
+ RecreateActor(this, aPrs3d);
}
}
// "Properties" submenu
mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
- mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
+ mgr->setRule( action( VISU_EDGE_COLOR ), aRule + aSurfFrameType + " and representation='VISU::SURFACEFRAME'" );
mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
" and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
"or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))" );
setPreferenceProperty( maxAngle, "max", 90 );
+ addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
sp = addPreference( "", representGr, LightApp_Preferences::Space );
}
theStr<<thePrefix<<theName<<".SetGaussMetric("<<aParam<<")"<<endl;
+ SALOMEDS::Color aColor = theServant->GetLinkColor();
+ theStr<<thePrefix<<theName<<".SetLinkColor(SALOMEDS.Color("<<
+ aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
if(theServant->IsRangeFixed())
theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
else
SetName((const char*)GenerateName().toLatin1(), false);
myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
- myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
+
+ QColor aColor = VISU::GetResourceMgr()->colorValue( "VISU", "edge_color", QColor( 255, 255, 255 ) );
+ SALOMEDS::Color aLinkColor;
+ aLinkColor.R = aColor.red()/255.;
+ aLinkColor.G = aColor.green()/255.;
+ aLinkColor.B = aColor.blue()/255.;
+ SetLinkColor(aLinkColor);
my2DQuadPrsType = VISU::Quadratic2DPresentationType(VISU::GetResourceMgr()->integerValue( "VISU", "quadratic_mode", 0));
}
#include "VISU_ScalarMapAct.h"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_LookupTable.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_ScalarBarActor.hxx"
#include "VISU_Convertor.hxx"
return aResult;
}
+//----------------------------------------------------------------------------
+namespace
+{
+ bool
+ IsSameColor(const SALOMEDS::Color& theLeft,
+ const SALOMEDS::Color& theRight)
+ {
+ return
+ VISU::CheckIsSameValue(theLeft.R, theRight.R) &&
+ VISU::CheckIsSameValue(theLeft.G, theRight.G) &&
+ VISU::CheckIsSameValue(theLeft.B, theRight.B);
+ }
+}
+
//----------------------------------------------------------------------------
int VISU::ScalarMap_i::myNbPresent = 0;
else
SetScaling(VISU::LINEAR);
+ QColor aColor = aResourceMgr->colorValue( "VISU", "edge_color", QColor( 255, 255, 255 ) );
+ SALOMEDS::Color aLinkColor;
+ aLinkColor.R = aColor.red()/255.;
+ aLinkColor.G = aColor.green()/255.;
+ aLinkColor.B = aColor.blue()/255.;
+ SetLinkColor(aLinkColor);
+
int aGaussMetric = aResourceMgr->integerValue("VISU", "scalar_gauss_metric", 0);
SetGaussMetric((VISU::GaussMetric)aGaussMetric);
SetGaussMetric(VISU::GaussMetric(VISU::Storable::FindValue(theMap,"myGaussMetric").toInt()));
+ SALOMEDS::Color aLinkColor;
+ aLinkColor.R = VISU::Storable::FindValue(theMap,"myLinkColor.R").toDouble();
+ aLinkColor.G = VISU::Storable::FindValue(theMap,"myLinkColor.G").toDouble();
+ aLinkColor.B = VISU::Storable::FindValue(theMap,"myLinkColor.B").toDouble();
+ SetLinkColor(aLinkColor);
+
// Check if the icon needs to be updated, update if necessary
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
Storable::DataToStream( theStr, "myScaling", GetScaling() );
Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
Storable::DataToStream( theStr, "myGaussMetric", int(GetGaussMetric()) );
+
+ SALOMEDS::Color aLinkColor = GetLinkColor();
+ Storable::DataToStream( theStr, "myLinkColor.R", aLinkColor.R );
+ Storable::DataToStream( theStr, "myLinkColor.G", aLinkColor.G );
+ Storable::DataToStream( theStr, "myLinkColor.B", aLinkColor.B );
}
(GetSpecificPL(), &VISU_ColoredPL::SetScaling, theScaling));
}
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SetLinkColor(const SALOMEDS::Color& theColor)
+{
+ if(IsSameColor(myLinkColor, theColor))
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myLinkColor = theColor;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+SALOMEDS::Color
+VISU::ScalarMap_i
+::GetLinkColor()
+{
+ return myLinkColor;
+}
+
//----------------------------------------------------------------------------
VISU::GaussMetric
VISU::ScalarMap_i
GetValLblFontColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
aProp->SetColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
}
+
+ // Update edge property
+ SALOMEDS::Color aLinkColor = GetLinkColor();
+ anActor->GetEdgeProperty()->SetColor(aLinkColor.R, aLinkColor.G, aLinkColor.B);
}
TSuperClass::UpdateActor(theActor);
}
void
SetScaling(VISU::Scaling theScaling);
+ //----------------------------------------------------------------------------
+ virtual
+ void
+ SetLinkColor(const SALOMEDS::Color& theColor);
+
+ virtual
+ SALOMEDS::Color
+ GetLinkColor();
+
//----------------------------------------------------------------------------
virtual
VISU::GaussMetric
private:
VISU_ScalarMapPL* myScalarMapPL;
+ SALOMEDS::Color myLinkColor;
bool myShowBar;
};
}