mgr->setRule( action( VISU_PLOT2D ), aRule, true );
// timestamp commands
- aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
+ aRule = "client='ObjectBrowser' and selcount=1 and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'}";
mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
}
GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
- VISU::Plot3D_i* aPrs3d = CreatePrs3d<VISU::Plot3D_i>(this, aTimeStampSObj, aMeshName.latin1(), (Entity)anEntity.toInt(),
- aFieldName.latin1(), aTimeStampId.toInt());
+ VISU::Plot3D_i* aPrs3d = CreatePrs3d<VISU::Plot3D_i>(this,
+ aTimeStampSObj,
+ aMeshName.latin1(),
+ (Entity)anEntity.toInt(),
+ aFieldName.latin1(),
+ aTimeStampId.toInt(),
+ ColoredPrs3d_i::EPublishUnderTimeStamp);
if (aPrs3d) {
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
mgr->setRule( action( GAUSS_CREATE_PRS ),
"client='ObjectBrowser' and selcount=1 "
- "and type='VISU::TTIMESTAMP' "
+ "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
"and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
"and $medSource in {'eImportFile' 'eCopyAndImportFile'} ",
true );
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- int theTimeId)
+ int theTimeId,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
VISU::Result_var aResult;
if (CheckResult(theModule,theTimeStamp,aResult)){
QApplication::setOverrideCursor(Qt::waitCursor);
TPrs3d_i* aPrs3d =
GetVisuGen(theModule)->template CreatePrs3d<TPrs3d_i>
- (aResult,theMeshName,theEntity,theFieldName,theTimeId);
+ (aResult,theMeshName,theEntity,theFieldName,theTimeId,thePublishInStudyMode);
QApplication::restoreOverrideCursor();
if(aPrs3d)
return aPrs3d;
bool
CreatePrs3d(VisuGUI* theModule,
_PTR(SObject) theTimeStamp,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
aMeshName.latin1(),
(Entity)anEntity.toInt(),
aFieldName.latin1(),
- aTimeStampId.toInt());
+ aTimeStampId.toInt(),
+ thePublishInStudyMode);
QApplication::restoreOverrideCursor();
if (aPrs3d) {
_PTR(SObject) aTimeStampSObj;
Handle(SALOME_InteractiveObject) anIO;
- if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+ ColoredPrs3d_i::EPublishInStudyMode aPublishInStudyMode;
+ if (!CheckTimeStamp(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
return;
// Create new TViewWindow instance, if it does not exist.
if (!GetViewWindow<TViewer>(theModule))
return;
- if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
+ if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
return;
theModule->application()->putInfo(QObject::tr("INF_DONE"));
bool
CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
- Handle(SALOME_InteractiveObject)* theIO)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
{
- Handle(SALOME_InteractiveObject) anIO;
+ Handle(SALOME_InteractiveObject) anIO = theIO;
CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
- if (theIO)
- *theIO = anIO;
if (!anIO.IsNull() && anIO->hasEntry()){
_PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
theSObject = aStudy->FindObjectID(anIO->getEntry());
QString aValue = getValue(theSObject,"myType");
- if (aValue.toInt() == int(VISU::TTIMESTAMP))
+ if (aValue.toInt() == int(VISU::TTIMESTAMP)){
+ thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
return true;
+ }
+ if (aValue.toInt() == int(VISU::TFIELD)){
+ thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently;
+ if(theSObject->FindSubObject(2,theSObject))
+ return true;
+ }
}
SUIT_MessageBox::warn1(GetDesktop(theModule),
QObject::tr("WRN_VISU"),
#include "SALOME_InteractiveObject.hxx"
#include "VISUConfig.hh"
+#include "VISU_ColoredPrs3d_i.hh"
#include "SALOMEDSClient_Study.hxx"
class SalomeApp_Study;
class VisuGUI;
-namespace VISU {
+namespace VISU
+{
class Prs3d_i;
class Result_i;
class Table_i;
// SObject type
bool CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
- Handle(SALOME_InteractiveObject)* theIO = NULL);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
_PTR(SObject) theSource,
VISU::Result_var& theResult);
myName = GenerateName().latin1();
CORBA::String_var anIOR = GetID();
std::string aFatherEntry = FindOrCreate3DPresentationsFolder(GetStudyDocument());
+ aComment.sprintf("myComment=%s",
+ GetComment());
CreateAttributes(GetStudyDocument(),
aFatherEntry,
"",
anIOR.in(),
myName,
"",
- "",
+ aComment.latin1(),
true);
SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
}
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- CORBA::Double theIteration)
+ CORBA::Double theIteration,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp)
{
if(myStudyDocument->GetProperties()->IsLocked())
return NULL;
Mutex mt(myMutex);
if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
if(TPrs3d_i::IsPossible(aResult,theMeshName,theEntity,theFieldName,int(theIteration))){
- TPrs3d_i* aPresent = new TPrs3d_i(aResult);
+ TPrs3d_i* aPresent = new TPrs3d_i(aResult,thePublishInStudyMode);
if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
return aPresent;
aPresent->_remove_ref();