visualization and NOT all properties can be set for a certain 3D
presentation.
+\anchor filter_by_scalars_anchor
+
<ul>
<li><b>Hide all</b> - allows to hide all objects from the
viewer.</li>
\image html viewing4.png
+\anchor rename_anchor
+
<li><b>Rename</b> - allows to rename the presentation.</li>
<li><b>Copy</b> - allows to create a copy of the presentation in the
same subfolder (time stamp) in the Object Browser.</li>
\image html values_labeling.png
</li>
+\anchor labeling_parameters_anchor
+
<li><b>Labeling Parameters</b> allows to change such labeling parameters as font and color.
\image html labeling_parameters.png
//! Get value of the distance between global and local scalar bars.
double GetSpacing();
+
+ /*!
+ * Returns visibility state of scalar bar
+ */
+ boolean IsBarVisible();
+
+ /*!
+ * Sets visibility state of scalar bar
+ */
+ void SetBarVisible(in boolean theVisible);
/*!
* Set the Multicolored mode.
//! Defines how many faces of can be drawn in the Geometrical Sphere primitive mode
long GetFaceLimit();
+
+
};
myPreHighlightActor->SetVisibility(false);
myCursorPyramid->SetVisibility(false);
- if (!myBarVisibility)
- return false;
+/* if (!myBarVisibility)
+ return false;*/
if(!theIsHighlight)
return true;
}
- if (!myBarVisibility)
- return false;
+/* if (!myBarVisibility)
+ return false;*/
if(aSelectionMode == ActorSelection)
VisuGUI
::SetScalarBarVisibility(bool theVisibility)
{
- printf ("\nOnHideScalarBar");
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
SALOME_ListIO aListIO;
aSelectionMgr->selectedObjects(aListIO);
bool update = false;
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It.Value();
- std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
- if (!aPrsList.empty()) {
+ std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO, true);
+ if ( aPrsList.size()>0 ) {
for (int i = 0, n = aPrsList.size(); i < n; i++) {
VISU::Prs3d_i* aPrsObject = aPrsList[i];
if (aPrsObject) {
- VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- if (aScalar) {
+ if (VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject)) {
aScalar->SetBarVisible( theVisibility );
RecreateActor(this, aScalar);
update = true;
- }
- }
+ } else if (VISU::GaussPoints_i* aGauss = dynamic_cast<VISU::GaussPoints_i*>(aPrsObject)) {
+ aGauss->SetBarVisible( theVisibility );
+ RecreateActor(this, aGauss);
+ update = true;
+ }
+ }
}
}
}
QString aTableOrContShow = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreHiddenCurves)";
QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
- QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
- QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
+ QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
+ QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
" or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
- QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})"
+ QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
" or ( ((type='VISU::TTABLE' and nbChildren>0) or"
" ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent;
- QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isScalarMapAct=1 and " + aPrsVisible + " and isScalarBarVisible )";
- QString aScalarBarShowRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isScalarMapAct=1 and " + aPrsVisible + " and (not isScalarBarVisible) )";
+ QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and (isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and isScalarBarVisible )";
+ QString aScalarBarShowRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and ( isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and (not isScalarBarVisible) )";
mgr->setRule( action( VISU_ERASE ), anEraseRule );
mgr->setRule( action( VISU_DISPLAY ), aDisplayRule );
aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
- createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_HIDE"), QIcon(),
+/* createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_HIDE"), QIcon(),
VisuGUI::tr("MEN_HIDE"), "", 0, this, false,
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
this, SLOT(OnDisplayOnlyPrs()));
mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
- aRule + " and ({true} in $canBeDisplayed)" );
+ aRule + " and ({true} in $canBeDisplayed)" );*/
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
+#include "VISU_GaussPtsAct.h"
#include "SalomeApp_Study.h"
#include "LightApp_Study.h"
else if ( p == "hasActor" ) val = QVariant( hasActor( ind ) );
else if ( p == "isShading" ) val = QVariant( isShading( ind ) );
else if ( p == "isScalarMapAct" ) val = QVariant( isScalarMapAct( ind ) );
+ else if ( p == "isGaussPtsAct" ) val = QVariant( isGaussPtsAct( ind ) );
else if ( p == "isVisuComponent") val = QVariant( isVisuComponent( ind ) );
else if ( p == "fullResolution" ) val = QVariant( fullResolution( ind ) );
else if ( p == "mediumResolution" ) val = QVariant( mediumResolution( ind ) );
return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
}
+//----------------------------------------------------------------------------
+struct TIsGaussPtsActFunctor: TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return dynamic_cast<VISU_GaussPtsAct*>(theActor)? "1" : "0";
+ }
+};
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::isGaussPtsAct( const int ind ) const
+{
+ return TPopupDispatcher<TIsGaussPtsActFunctor>()(myModule, entry(ind));
+}
//----------------------------------------------------------------------------
bool VisuGUI_Selection::isVisuComponent( const int ind ) const
{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
return anActor->GetBarVisibility() ? "true" : "false";
+ else if ( VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor))
+ return anActor->GetBarVisibility() ? "true" : "false";
return QString();
}
};
bool hasActor( const int ) const;
QString isShading( const int ) const;
QString isScalarMapAct( const int ) const;
+ QString isGaussPtsAct( const int ) const;
bool isScalarBarVisible( const int ) const;
bool isVisuComponent( const int ) const;
QString isValuesLabeled( const int ) const;
// GetPrs3dList: find list of presentations for the given object
// ========================================================================================
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ bool theGP)
{
std::vector<VISU::Prs3d_i*> aList;
if (!theIO.IsNull() && theIO->hasEntry()) {
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
_PTR(SObject) aSObject = aCStudy->FindObjectID(theIO->getEntry());
- aList = GetPrs3dList(theModule, aSObject);
+ aList = GetPrs3dList(theModule, aSObject, theGP);
}
return aList;
}
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- _PTR(SObject) theObject)
+ _PTR(SObject) theObject,
+ bool theGP)
{
std::vector<VISU::Prs3d_i*> aList; int k = 0;
if (!theObject)
if (!CORBA::is_nil(aVisuObj)) {
VISU::VISUType aType = aVisuObj->GetType();
switch (aType) {
+ case VISU::TGAUSSPOINTS:
+ if ( !theGP ) break;
case VISU::TSCALARMAP:
case VISU::TISOSURFACES:
case VISU::TDEFORMEDSHAPE:
// Others
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ bool theGP = false);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- _PTR(SObject) theObject);
+ _PTR(SObject) theObject,
+ bool theGP = false);
int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow);
void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
theStr<<thePrefix<<theName<<".SetMagnification("<<theServant->GetMagnification()<<")"<<endl;
theStr<<thePrefix<<theName<<".SetMagnificationIncrement("<<theServant->GetMagnificationIncrement()<<")"<<endl;
+
+ std::string aVisible = theServant->IsBarVisible()? "True" : "False";
+ theStr<<thePrefix<<theName<<".SetBarVisible("<<aVisible<<")"<<endl;
return thePrefix;
}
myIsActiveLocalScalarBar(true),
myIsDispGlobalScalarBar(true),
mySpacing(0.01),
- myFaceLimit(50000)
+ myFaceLimit(50000),
+ myShowBar(true)
{
if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
}
anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture );
SetTextures( aMainTexture.toLatin1().data(), anAlphaTexture.toLatin1().data() );
+
+ myShowBar = true;
return this;
}
SetColor(anOrigin->GetColor());
+ SetBarVisible(anOrigin->IsBarVisible());
+
SetTextures(anOrigin->GetMainTexture(), anOrigin->GetAlphaTexture());
}
}
CORBA::String_var aPixMapName = aPixmap->GetPixMap();
if(strcmp(GetIconName(), aPixMapName.in()) != 0)
aPixmap->SetPixMap(GetIconName());
+
+ QString aVal = VISU::Storable::FindValue(theMap,"myShowBar", "1");
+ SetBarVisible((aVal.toInt() == 1)? true : false);
SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt());
SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt());
Storable::DataToStream( theStr, "myAlphaTexture", GetQAlphaTexture() );
Storable::DataToStream( theStr, "myResolution", GetResolution() );
+ Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
}
return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
-
+void VISU::GaussPoints_i::SetBarVisible(CORBA::Boolean theVisible)
+{
+ if (myShowBar == theVisible)
+ return;
+ VISU::TSetModified aModified(this);
+ myShowBar = theVisible;
+ myParamsTime.Modified();
+}
+
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
::CreateActor()
{
VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
+ anActor->SetBarVisibility(myShowBar);
if(OnCreateActor(anActor))
return anActor;
return NULL;
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl();
if(GetIsColored()){
- anActor->SetBarVisibility(true);
GetPipeLine()->GetMapper()->SetScalarVisibility(1);
if(IsRangeFixed()){
aScalarBarCtrl->Update();
}else{
- anActor->SetBarVisibility(false);
-
GetPipeLine()->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.red() / 255.0,
myColor.green() / 255.0,
myColor.blue() / 255.0);
}
+
+ anActor->SetBarVisibility(myShowBar);
if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
theActor->SetRepresentation( VTK_POINTS );
//! Get path to the image using for Main Point Sprite texture.
QString
GetQMainTexture();
-
+
char*
GetMainTexture();
{
return myGaussPointsPL;
}
+
+ virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
+
+ virtual void SetBarVisible(CORBA::Boolean theVisible);
//----------------------------------------------------------------------------
//! Sets initial source geometry
virtual
void
UpdateFromActor(VISU_GaussPtsAct* theActor);
+
+ private:
+ bool myShowBar;
};
}