case VISU::TMESH:
{
VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
- VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
+ VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetCResult());
aSameMesh->SameAs(aMeshPrs);
}
break;
case VISU::TSCALARMAP:
{
VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
+ VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetCResult());
aSameScalar->SameAs(aScalarPrs);
}
break;
case VISU::TDEFORMEDSHAPE:
{
VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
- VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
+ VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetCResult());
aSameDeformed->SameAs(aDefPrs);
}
break;
VISU::ScalarMapOnDeformedShape_i* aDefPrs =
dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed =
- new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
+ new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetCResult());
aSameScalarMapOnDeformed->SameAs(aDefPrs);
}
break;
case VISU::TCUTPLANES:
{
VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
- VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
+ VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetCResult());
aSameCut->SameAs(aCutPrs);
}
break;
case VISU::TCUTLINES:
{
VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
- VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
+ VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetCResult());
aSameCut->SameAs(aCutPrs);
}
break;
case VISU::TISOSURFACE:
{
VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
- VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
+ VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetCResult());
aSameIso->SameAs(aIsoPrs);
}
break;
case VISU::TSTREAMLINES:
{
VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
- VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
+ VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetCResult());
aSameLines->SameAs(aLinesPrs);
}
break;
case VISU::TVECTORS:
{
VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
- VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
+ VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetCResult());
aSameVectors->SameAs(aVectorsPrs);
}
break;
case VISU::TPLOT3D:
{
VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
- VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult(),true);
+ VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetCResult());
aSamePlot3D->SameAs(aPlot3DPrs);
}
break;
if (myPlanes.empty() || myIsSelectPlane || !WidgetIJKTab->isEnabled())
return;
- VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
+ VISU::Result_i* result = myPrs3d ? myPrs3d->GetCResult() : 0;
if (!result)
return;
//=================================================================================
void VisuGUI_ClippingDlg::setIJKByNonStructured()
{
- if (!myPrs3d || myPlanes.empty() || !myPrs3d->GetResult())
+ if (!myPrs3d || myPlanes.empty() || !myPrs3d->GetCResult())
return;
// get plane normal
gp_Dir dir, gridDir;
double maxDot = 0;
const vector<vtkFloatingPointType> *curValues, *values = 0;
- VISU::Result_i* result = myPrs3d->GetResult();
+ VISU::Result_i* result = myPrs3d->GetCResult();
for (i = 0; i < 3; ++i) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
CORBA::String_var aMeshName = myPrs3d->GetMeshName();
//=================================================================================
bool VisuGUI_ClippingDlg::isStructured() const
{
- VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
+ VISU::Result_i* result = myPrs3d ? myPrs3d->GetCResult() : 0;
if (result) {
gp_Dir dir;
CORBA::String_var aMeshName = myPrs3d->GetMeshName();
{
// set index range
int maxIndex = 0;
- VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
+ VISU::Result_i* result = myPrs3d ? myPrs3d->GetCResult() : 0;
if (result) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
gp_Dir dir;
setOrientation2(thePrs->GetOrientationType2());
hasInit = true;
- myCutLines = new VISU::CutLines_i(thePrs->GetResult(),false);
+ myCutLines = new VISU::CutLines_i(thePrs->GetCResult(),
+ VISU::ColoredPrs3d_i::EDoNotPublish);
myCutLines->SameAs(thePrs);
myCutLines->CopyCurvesInverted(thePrs->GetCurvesInverted());
if (myCutLines->IsAllCurvesInverted()) myAllCurvesInvertedCheck->setChecked(true);
myPosSpn->setValue(thePrs->GetDisplacement());
hasInit = true;
// init table
- myCutPlanes = new VISU::CutPlanes_i(thePrs->GetResult(),false);
+ myCutPlanes = new VISU::CutPlanes_i(thePrs->GetCResult(),
+ VISU::ColoredPrs3d_i::EDoNotPublish);
myCutPlanes->SameAs(thePrs);
DrawTable();
const int theIter,
const VISU::TEntity theEntity){
float ret=1;
- VISU::Result_i* theResult = myPrs->GetResult();
+ VISU::Result_i* theResult = myPrs->GetCResult();
VISU::PField aField = theResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
if(!aField) return ret;
VISU::TValField& aValField = aField->myValField;
//===========================================================================
static Storable::TCallbackMap VisuStoreMap;
- string Storable::ToString(){
+ std::string
+ Storable
+ ::ToString()
+ {
ostringstream strOut;
Storable::DataToStream( strOut, "myComment", GetComment() );
ToStream(strOut);
return strOut.str();
}
- void Storable::Registry(const char* theComment, TStorableEngine theEngine)
+ void
+ Storable
+ ::Registry(const std::string& theComment,
+ TStorableEngine theEngine)
{
if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
}
}
- void Storable::StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap){
+ void
+ Storable
+ ::StrToMap(const QString& theStr,
+ VISU::Storable::TRestoringMap& theMap)
+ {
if(0 && MYDEBUG) MESSAGE("Storable::StrToMap : string="<<theStr);
QStringList strList = QStringList::split( ";", theStr, false );
for ( int i = 0; i < strList.count(); i++ ) {
}
}
- void Storable::DataToStream(ostringstream& theStr, const QString& theName, const QString& theVal) {
+ void
+ Storable
+ ::DataToStream(std::ostringstream& theStr,
+ const QString& theName,
+ const QString& theVal)
+ {
QString output = ( !theName.isNull() ? theName : QString("") )
+ QString( "=" )
+ ( !theVal.isNull() ? theVal : QString("") );
theStr<<output.latin1()<<";";
}
- void Storable::DataToStream(ostringstream& theStr, const QString& theName, const int theVal) {
+ void
+ Storable
+ ::DataToStream(std::ostringstream& theStr,
+ const QString& theName,
+ const int theVal)
+ {
QString output = ( !theName.isNull() ? theName : QString("") )
+ QString( "=" )
+ QString::number( theVal );
theStr<<output.latin1()<<";";
}
- void Storable::DataToStream(ostringstream& theStr, const QString& theName, const double theVal) {
+ void
+ Storable
+ ::DataToStream(std::ostringstream& theStr,
+ const QString& theName,
+ const double theVal)
+ {
QString output = ( !theName.isNull() ? theName : QString("") )
+ QString( "=" )
+ QString::number( theVal );
theStr<<output.latin1()<<";";
}
- Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const string& theLocalPersistentID)
+
+ Storable*
+ Storable
+ ::Create(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix,
+ const std::string& theLocalPersistentID)
{
try{
QString strIn( theLocalPersistentID.c_str() );
return NULL;
}
- QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
+ QString
+ Storable
+ ::FindValue(const TRestoringMap& theMap,
+ const std::string& theArg,
+ bool* isFind)
{
TRestoringMap::const_iterator i = theMap.find(theArg);
if(i == theMap.end()) {
}
- QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, const QString& theDefaultValue)
+ QString
+ Storable
+ ::FindValue(const TRestoringMap& theMap,
+ const std::string& theArg,
+ const QString& theDefaultValue)
{
bool anIsFound = false;
QString aValue = FindValue(theMap,theArg,&anIsFound);
//===========================================================================
- PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){
+ PortableServer::ServantBase_var
+ GetServant(CORBA::Object_ptr theObject)
+ {
if(CORBA::is_nil(theObject)) return NULL;
try{
PortableServer::POA_ptr aPOA = Base_i::GetPOA();
//===========================================================================
- CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr theSObject){
+ CORBA::Object_var
+ SObjectToObject(SALOMEDS::SObject_ptr theSObject)
+ {
SALOMEDS::GenericAttribute_var anAttr;
CORBA::Object_var anObj;
try{
}
//===========================================================================
- CORBA::Object_var ClientSObjectToObject(_PTR(SObject) theSObject){
+ CORBA::Object_var
+ ClientSObjectToObject(_PTR(SObject) theSObject)
+ {
_PTR(GenericAttribute) anAttr;
CORBA::Object_var anObj;
try{
//===========================================================================
- string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
- const char* theComment, int IsAllLevels)
+ std::string
+ FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument,
+ const std::string& theStartEntry,
+ const std::string& theComment,
+ int IsAllLevels)
{
SALOMEDS::ChildIterator_var anIter =
- theStudyDocument->NewChildIterator(theStudyDocument->FindObjectID(theStartEntry));
+ theStudyDocument->NewChildIterator(theStudyDocument->FindObjectID(theStartEntry.c_str()));
anIter->InitEx(IsAllLevels);
SALOMEDS::SObject_var aFieldSO;
for(;anIter->More();anIter->Next()) {
return "";
}
//===========================================================================
- string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
- const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
- const char* thePersistentRef, const char* theComment,
- CORBA::Boolean theCreateNew)
+ std::string
+ CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
+ const std::string& theFatherEntry,
+ const std::string& theRefFatherEntry,
+ const std::string& theIOR,
+ const std::string& theName,
+ const std::string& thePersistentRef,
+ const std::string& theComment,
+ CORBA::Boolean theCreateNew)
{
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder();
- SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry);
+ SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry.c_str());
SALOMEDS::SObject_var newObj;
if (theCreateNew) newObj = aStudyBuilder->NewObject(aFather);
else newObj = aFather;
SALOMEDS::GenericAttribute_var anAttr;
- if(strcmp(theIOR,"") != 0){
+ if(theIOR != ""){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(theIOR);
+ anIOR->SetValue(theIOR.c_str());
}
- if(strcmp(theName,"") != 0){
+ if(theName != ""){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theName);
+ aName->SetValue(theName.c_str());
}
- if(strcmp(thePersistentRef,"") != 0){
+ if(thePersistentRef != ""){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
SALOMEDS::AttributePersistentRef_var aPRef = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
- aPRef->SetValue(thePersistentRef);
+ aPRef->SetValue(thePersistentRef.c_str());
}
- if(strcmp(theComment,"") != 0){
+ if(theComment != ""){
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
- aCmnt->SetValue(theComment);
+ aCmnt->SetValue(theComment.c_str());
if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
}
- if(strcmp(theRefFatherEntry,"") != 0){
- SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
+ if(theRefFatherEntry != ""){
+ SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry.c_str());
SALOMEDS::SObject_var anObj = aStudyBuilder->NewObject(aRefFather);
aStudyBuilder->Addreference(anObj,newObj);
}
INFOS("CreateAttributes - StudyId = "<<theStudyDocument->StudyId()<<"; anEntry = "<<aRet<<"; IOR = '"<<theIOR<<"'");
return aRet;
}
- string CreateAttributes(_PTR(Study) theStudyDocument,
- const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
- const char* thePersistentRef, const char* theComment,
- CORBA::Boolean theCreateNew)
+
+ std::string
+ CreateAttributes(_PTR(Study) theStudyDocument,
+ const std::string& theFatherEntry,
+ const std::string& theRefFatherEntry,
+ const std::string& theIOR,
+ const std::string& theName,
+ const std::string& thePersistentRef,
+ const std::string& theComment,
+ CORBA::Boolean theCreateNew)
{
_PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
_PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
newObj = aFather;
_PTR(GenericAttribute) anAttr;
- if (strcmp(theIOR, "") != 0) {
+ if (theIOR != "") {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
_PTR(AttributeIOR) anIOR (anAttr);
anIOR->SetValue(theIOR);
}
- if (strcmp(theName, "") != 0) {
+ if (theName != "") {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
_PTR(AttributeName) aName (anAttr);
aName->SetValue(theName);
}
- if (strcmp(thePersistentRef, "") != 0) {
+ if (thePersistentRef != "") {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
_PTR(AttributePersistentRef) aPRef (anAttr);
aPRef->SetValue(thePersistentRef);
}
- if (strcmp(theComment, "") != 0) {
+ if (theComment != "") {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
_PTR(AttributeComment) aCmnt (anAttr);
aCmnt->SetValue(theComment);
if (MYDEBUG) INFOS("CreateAttributes - Comment = " << theComment);
}
- if (strcmp(theRefFatherEntry, "") != 0) {
+ if (theRefFatherEntry != "") {
_PTR(SObject) aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
_PTR(SObject) anObj = aStudyBuilder->NewObject(aRefFather);
aStudyBuilder->Addreference(anObj, newObj);
return aRet;
}
- QString GenerateName(const string& theFmt, int theId){
+ QString
+ GenerateName(const string& theFmt, int theId)
+ {
static QString aName;
if(theId > 0)
aName.sprintf("%s:%d",theFmt.c_str(),theId);
}
- SALOMEDS::StudyManager_var GetStudyManager()
+ SALOMEDS::StudyManager_var
+ GetStudyManager()
{
static SALOMEDS::StudyManager_var aStudyManager;
if(CORBA::is_nil(aStudyManager)){
}
- SALOMEDS::Study_var GetDSStudy(_PTR(Study) theStudy)
+ SALOMEDS::Study_var
+ GetDSStudy(_PTR(Study) theStudy)
{
//std::string aStudyName = theStudy->Name();
//return GetStudyManager()->GetStudyByName(aStudyName.c_str());
return GetStudyManager()->GetStudyByID(aStudyID);
}
- SALOMEDS::SObject_var GetSObject( _PTR(SObject) obj )
+ SALOMEDS::SObject_var
+ GetSObject( _PTR(SObject) obj )
{
_PTR(Study) aStudy = obj->GetStudy();
SALOMEDS::Study_var aSalomeDSStudy = GetDSStudy( aStudy );
return aSalomeDSStudy->FindObjectID( id.c_str() );
}
- _PTR(SObject) GetClientSObject( SALOMEDS::SObject_var obj,
- _PTR(Study) study )
+ _PTR(SObject)
+ GetClientSObject( SALOMEDS::SObject_var obj,
+ _PTR(Study) study )
{
return study->FindObjectID( obj->GetID() );
}
- void RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
- bool theIsAttrOnly,
- bool theDestroySubObjects)
+ void
+ RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
+ bool theIsAttrOnly,
+ bool theDestroySubObjects)
{
if (theSObject->_is_nil()) return;
aStudyBuilder->RemoveObjectWithChildren(theSObject);
}
- void RemoveFromStudy (_PTR(SObject) theSObject,
- bool theIsAttrOnly,
- bool theDestroySubObjects)
+ void
+ RemoveFromStudy (_PTR(SObject) theSObject,
+ bool theIsAttrOnly,
+ bool theDestroySubObjects)
{
if (!theSObject) return;
protected:
virtual void ToStream(std::ostringstream& theStr) = 0;
public:
- std::string ToString();
- virtual const char* GetComment() const = 0;
+ std::string
+ ToString();
+
+ virtual
+ const char*
+ GetComment() const = 0;
+
typedef std::map<std::string,QString> TRestoringMap;
+
typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix, const TRestoringMap& theMap);
+ const std::string& thePrefix,
+ const TRestoringMap& theMap);
typedef std::map<std::string,TStorableEngine> TCallbackMap;
- static void Registry(const char* theComment, TStorableEngine theEngine);
- static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
- static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
- static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, const QString& theDefaultValue);
- static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
- static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
- static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
- static void DataToStream(std::ostringstream& theStr, const QString& theName, const int theVal);
- static void DataToStream(std::ostringstream& theStr, const QString& theName, const double theVal);
+
+ static
+ void
+ Registry(const std::string& theComment,
+ TStorableEngine theEngine);
+
+ static
+ Storable*
+ Create(SALOMEDS::SObject_ptr,
+ const std::string& thePrefix,
+ const std::string& theString);
+
+ static
+ QString
+ FindValue(const TRestoringMap& theMap,
+ const std::string& theArg,
+ bool* isFind = NULL);
+
+ static
+ QString
+ FindValue(const TRestoringMap& theMap,
+ const std::string& theArg,
+ const QString& theDefaultValue);
+
+ static
+ void
+ StrToMap(const QString& theStr,
+ VISU::Storable::TRestoringMap& theMap);
+
+ static
+ SALOMEDS::SObject_ptr
+ GetResultSO(SALOMEDS::SObject_ptr theSObject);
+
+ static
+ void
+ DataToStream(std::ostringstream& theStr,
+ const QString& theName,
+ const QString& theVal);
+
+ static
+ void
+ DataToStream(std::ostringstream& theStr,
+ const QString& theName,
+ const int theVal);
+
+ static
+ void
+ DataToStream(std::ostringstream& theStr,
+ const QString& theName,
+ const double theVal);
};
//===========================================================================
_PTR(SComponent) ClientFindOrCreateVisuComponent(_PTR(Study) theStudyDocument);
SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument);
- std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
- const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
- const char* thePersistentRef, const char* theComment,
- CORBA::Boolean theCreateNew = true);
-
- std::string CreateAttributes(_PTR(Study) theStudyDocument,
- const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
- const char* thePersistentRef, const char* theComment,
- CORBA::Boolean theCreateNew = true);
-
- std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
- const char* theComment, int IsAllLevels = true);
-
- SALOMEDS::SObject_var GetSObject(_PTR(SObject));
- _PTR(SObject) GetClientSObject(SALOMEDS::SObject_var, _PTR(Study));
-
- SALOMEDS::Study_var GetDSStudy(_PTR(Study));
-
- void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
- bool theIsAttrOnly = true,
- bool theDestroySubObjects = false);
- void RemoveFromStudy(_PTR(SObject) theSObject,
- bool theIsAttrOnly = true,
- bool theDestroySubObjects = false);
+ std::string
+ CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
+ const std::string& theFatherEntry,
+ const std::string& theRefFatherEntry,
+ const std::string& theIOR,
+ const std::string& theName,
+ const std::string& thePersistentRef,
+ const std::string& theComment,
+ CORBA::Boolean theCreateNew = true);
+
+ std::string
+ CreateAttributes(_PTR(Study) theStudyDocument,
+ const std::string& theFatherEntry,
+ const std::string& theRefFatherEntry,
+ const std::string& theIOR,
+ const std::string& theName,
+ const std::string& thePersistentRef,
+ const std::string& theComment,
+ CORBA::Boolean theCreateNew = true);
+
+ std::string
+ FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument,
+ const std::string& theStartEntry,
+ const std::string& theComment,
+ int IsAllLevels = true);
+
+ SALOMEDS::SObject_var
+ GetSObject(_PTR(SObject));
+
+ _PTR(SObject)
+ GetClientSObject(SALOMEDS::SObject_var, _PTR(Study));
+
+ SALOMEDS::Study_var
+ GetDSStudy(_PTR(Study));
+
+ void
+ RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
+ bool theIsAttrOnly = true,
+ bool theDestroySubObjects = false);
+ void
+ RemoveFromStudy(_PTR(SObject) theSObject,
+ bool theIsAttrOnly = true,
+ bool theDestroySubObjects = false);
}
#endif
//============================================================================
VISU::ColoredPrs3d_i::
ColoredPrs3d_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ myPublishInStudyMode(thePublishInStudyMode),
myScalarMapPL(NULL),
myIsFixedRange(false)
{}
//---------------------------------------------------------------
VISU::ColoredPrs3d_i::
ColoredPrs3d_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
+ myPublishInStudyMode(EDoNotPublish),
myScalarMapPL(NULL),
myIsFixedRange(false)
{}
if(TSuperClass::SetInput()){
if(CheckIsPossible()){
if(OnSetInput()){
- if(Create(GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber()))
+ if(Create(GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber()))
return true;
}else
return true;
return myEntity;
}
+
+//----------------------------------------------------------------------------
+VISU::TEntity
+VISU::ColoredPrs3d_i
+::GetTEntity() const
+{
+ return VISU::TEntity(int(myEntity));
+}
+
+
+//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
::SetFieldName(const char* theFieldName)
}
}
+
+//----------------------------------------------------------------------------
char*
VISU::ColoredPrs3d_i
::GetFieldName()
return CORBA::string_dup(myFieldName.c_str());
}
+
+//----------------------------------------------------------------------------
+std::string
+VISU::ColoredPrs3d_i
+::GetCFieldName() const
+{
+ return myFieldName;
+}
+
+
+//----------------------------------------------------------------------------
+const VISU::PField&
+VISU::ColoredPrs3d_i
+::GetField() const
+{
+ return myField;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetField(VISU::PField theField)
+{
+ myField = theField;
+}
+
+
+//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
}
}
+
+//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
::GetTimeStampNumber()
if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
- SetMeshName(anOrigin->GetMeshName());
+ SetMeshName(anOrigin->GetCMeshName().c_str());
SetEntity(anOrigin->GetEntity());
- SetFieldName(anOrigin->GetFieldName());
+ SetFieldName(anOrigin->GetCFieldName().c_str());
SetTimeStampNumber(anOrigin->GetTimeStampNumber());
OnSetInput();
VISU::ColoredPrs3d_i
::GetTimeStampsRange()
{
+ // To exclude timstamps with repeated time
typedef std::map<std::string, long> TTimeStampsRange;
TTimeStampsRange aRange;
{
aRange[aTime] = aTimeStampNumber;
}
}
- VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
+
+ // To sort timestamps according to their timestamp number
+ typedef std::map<long, std::string> TTimeStampsSortedRange;
+ TTimeStampsSortedRange aSortedRange;
{
- aTimeStampsRange->length(aRange.size());
TTimeStampsRange::const_iterator anIter = aRange.begin();
for(size_t aCounter = 0; anIter != aRange.end(); anIter++, aCounter++){
vtkIdType aTimeStampNumber = anIter->second;
const std::string& aTime = anIter->first;
+ aSortedRange[aTimeStampNumber] = aTime;
+ }
+ }
+
+ // To map the C++ data structures to the corresponding CORBA ones
+ VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange();
+ {
+ aTimeStampsRange->length(aRange.size());
+ TTimeStampsSortedRange::const_iterator anIter = aSortedRange.begin();
+ for(size_t aCounter = 0; anIter != aSortedRange.end(); anIter++, aCounter++){
+ vtkIdType aTimeStampNumber = anIter->first;
+ const std::string& aTime = anIter->second;
VISU::ColoredPrs3d::TimeStampInfo anInfo;
anInfo.myNumber = aTimeStampNumber;
anInfo.myTime = aTime.c_str();
void
VISU::ColoredPrs3d_i
-::SetTitle(const char* theName)
+::SetTitle(const char* theTitle)
{
- if(myTitle != theName){
- myTitle = theName;
+ if(myTitle != theTitle){
+ myTitle = theTitle;
myParamsTime.Modified();
}
}
return CORBA::string_dup(myTitle.c_str());
}
+std::string
+VISU::ColoredPrs3d_i
+::GetCTitle()
+{
+ return myTitle;
+}
+
bool
VISU::ColoredPrs3d_i
::IsBoldTitle()
}
+//----------------------------------------------------------------------------
+bool
+VISU::ColoredPrs3d_i
+::IsRangeFixed()
+{
+ return myIsFixedRange;
+}
+
+void
+VISU::ColoredPrs3d_i
+::UseFixedRange(bool theUseFixedRange)
+{
+ myIsFixedRange = theUseFixedRange;
+}
+
//----------------------------------------------------------------------------
/**
* Creates ColoredPrs3d and initialises it from resources
*/
VISU::Storable*
VISU::ColoredPrs3d_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
- SetMeshName(theMeshName);
+ SetMeshName(theMeshName.c_str());
SetEntity(theEntity);
- SetFieldName(theFieldName);
+ SetFieldName(theFieldName.c_str());
SetTimeStampNumber(theTimeStampNumber);
OnSetInput();
SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
OnSetInput();
- myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
-
Build(ERestore);
TSuperClass::Restore(theMap);
Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
Storable::DataToStream( theStr, "myOrientation", myOrientation );
- Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
- Storable::DataToStream( theStr, "myEntity", myEntity );
- Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
- Storable::DataToStream( theStr, "myIteration", int(myTimeStampNumber) );
+ Storable::DataToStream( theStr, "myMeshName", GetCMeshName() );
+ Storable::DataToStream( theStr, "myEntity", GetEntity() );
+ Storable::DataToStream( theStr, "myFieldName", GetCFieldName() );
+ Storable::DataToStream( theStr, "myIteration", int(GetTimeStampNumber()) );
Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
SetPipeLine(myScalarMapPL);
}
+//----------------------------------------------------------------------------
+std::string
+FindOrCreate3DPresentationsFolder(SALOMEDS::Study_ptr theStudy)
+{
+ static char aFolderName[] = "3D Presentations";
+ CORBA::String_var anEntry;
+ SALOMEDS::SObject_var aSObject = theStudy->FindObject(aFolderName);
+ if(!CORBA::is_nil(aSObject) && aSObject->Depth() == 3){
+ anEntry = aSObject->GetID();
+ return anEntry.in();
+ }
+ SALOMEDS::SComponent_var aSComponent = VISU::FindOrCreateVisuComponent(theStudy);
+ CORBA::String_var aFatherEntry = aSComponent->GetID();
+ anEntry = VISU::CreateAttributes(theStudy,
+ aFatherEntry.in(),
+ "",
+ "",
+ aFolderName,
+ "",
+ "",
+ true).c_str();
+ return anEntry.in();
+}
+
//----------------------------------------------------------------------------
VISU::Storable*
VISU::ColoredPrs3d_i
if(MYDEBUG)
MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theBuildMode = "<<theBuildMode);
SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
- if(myAddToStudy)
+ if(myPublishInStudyMode != EDoNotPublish)
aStudyBuilder->NewCommand(); // There is a transaction
#ifndef _DEXCEPT_
try{
if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
if(!myIsFixedRange)
myScalarMapPL->SetSourceRange();
- const VISU::TValField& aValField = myField->myValField;
- const VISU::PValForTime aValForTime = aValField.find(myTimeStampNumber)->second;
- aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
+ const VISU::TValField& aValField = GetField()->myValField;
+ const VISU::PValForTime aValForTime = aValField.find(GetTimeStampNumber())->second;
+ aComment.sprintf("%s %s",
+ GetCFieldName().c_str(),
+ VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
if(theBuildMode == ECreateNew)
myTitle = aComment.simplifyWhiteSpace().latin1();
}
- if(myAddToStudy){
+ if(myPublishInStudyMode == EPublishUnderTimeStamp){
myName = GenerateName().latin1();
aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
- std::string aResultEntry = myResult->GetEntry();
- std::string aRefFatherEntry = myResult->GetRefFatherEntry();
- std::string anEntry = myResult->GetEntry(aComment.latin1());
+ VISU::TTIMESTAMP,
+ GetCMeshName().c_str(),
+ GetEntity(),
+ GetCFieldName().c_str(),
+ GetTimeStampNumber(),
+ GetField()->myNbComp);
+ std::string aResultEntry = GetCResult()->GetEntry();
+ std::string aRefFatherEntry = GetCResult()->GetRefFatherEntry();
+ std::string anEntry = GetCResult()->GetEntry(aComment.latin1());
if(anEntry == "")
throw std::runtime_error("There is no Entry for binding the presentation !!!");
aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
+ GetComment(),
+ GetCMeshName().c_str(),
+ GetEntity(),
+ GetCFieldName().c_str(),
+ GetTimeStampNumber(),
+ GetField()->myNbComp);
CORBA::String_var anIOR = GetID();
- CreateAttributes(GetStudyDocument(),anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
- mySObject = GetStudyDocument()->FindObjectIOR(anIOR);
+ CreateAttributes(GetStudyDocument(),
+ anEntry,
+ aRefFatherEntry,
+ anIOR.in(),
+ myName,
+ "",
+ aComment.latin1(),
+ true);
+ SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
+ }else if(myPublishInStudyMode == EPublishIndependently){
+ myName = GenerateName().latin1();
+ CORBA::String_var anIOR = GetID();
+ std::string aFatherEntry = FindOrCreate3DPresentationsFolder(GetStudyDocument());
+ CreateAttributes(GetStudyDocument(),
+ aFatherEntry,
+ "",
+ anIOR.in(),
+ myName,
+ "",
+ "",
+ true);
+ SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
}
#ifndef _DEXCEPT_
}catch(std::exception& exc){
throw;
}
#endif
- if(myAddToStudy)
+ if(myPublishInStudyMode != EDoNotPublish)
aStudyBuilder->CommitCommand();
return this;
}
-
-
-//----------------------------------------------------------------------------
-const VISU::PField&
-VISU::ColoredPrs3d_i
-::GetField() const
-{
- return myField;
-}
-
-VISU::TEntity
-VISU::ColoredPrs3d_i
-::GetTEntity() const
-{
- return VISU::TEntity(int(myEntity));
-}
//----------------------------------------------------------------------------
typedef Prs3d_i TSuperClass;
+ /*!
+ The enumeration allow to define what mode should be used for the presentation building.
+ */
+ enum EPublishInStudyMode {EPublishUnderTimeStamp, EPublishIndependently, EDoNotPublish};
+
explicit
ColoredPrs3d_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
ColoredPrs3d_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~ColoredPrs3d_i();
Entity
GetEntity();
+ TEntity
+ GetTEntity() const;
+
virtual
void
SetFieldName(const char* theFieldName);
char*
GetFieldName();
+ std::string
+ GetCFieldName() const;
+
+ virtual
+ const VISU::PField&
+ GetField() const;
+
virtual
void
SetTimeStampNumber(CORBA::Long theTimeStampNumber);
virtual
void
- SetTitle(const char* theName);
+ SetTitle(const char* theTitle);
virtual
char*
GetTitle();
- //----------------------------------------------------------------------------
- protected:
- VISU::ScalarMap::Orientation myOrientation;
- std::string myTitle;
- int myNumberOfLabels;
- vtkFloatingPointType myPosition[2], myWidth, myHeight;
+ std::string
+ GetCTitle();
+ //----------------------------------------------------------------------------
public:
/*!
Initlizes the in first time presentation
*/
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
/*!
void
SameAsParams(const ColoredPrs3d_i* theOrigin);
- TEntity
- GetTEntity() const;
-
- virtual const VISU::PField&
- GetField() const;
-
virtual
bool
IsBoldTitle();
vtkFloatingPointType theG,
vtkFloatingPointType theB);
+ virtual
+ bool
+ IsRangeFixed();
+
VISU_ScalarMapPL*
GetSpecificPL() const
{
Storable*
Build(EBuildMode theBuildMode);
- protected:
+ void
+ SetField(VISU::PField theField);
+
+ void
+ UseFixedRange(bool theUseFixedRange);
+
+ private:
// Decalare basic input parameters
Entity myEntity;
std::string myFieldName;
CORBA::Long myTimeStampNumber;
PField myField;
-
+ EPublishInStudyMode myPublishInStudyMode;
+
+ std::string myTitle;
+ int myNumberOfLabels;
+ VISU::ScalarMap::Orientation myOrientation;
+ vtkFloatingPointType myPosition[2], myWidth, myHeight;
+
//Font management
bool myIsBoldTitle;
bool myIsItalicTitle;
int
VISU::CutLines_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//---------------------------------------------------------------
VISU::CutLines_i::
CutLines_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
myCutLinesPL(NULL)
{}
//---------------------------------------------------------------
VISU::CutLines_i::
CutLines_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::CutLines_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::CutLines_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
//---------------------------------------------------------------
void
VISU::CutLines_i
-::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject)
+::BuildTableOfReal(SALOMEDS::SObject_var theSObject)
{
try{
if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
typedef map<long,long> TLineIdCont;
QString aTitle;
- aTitle.sprintf("%s",myTitle.c_str());
+ aTitle.sprintf("%s",GetCTitle().c_str());
aTitle = aTitle.simplifyWhiteSpace();
aTableOfReal->SetTitle(aTitle.latin1());
{
aTableOfReal->SetRowTitle(1,"X");
aTableOfReal->SetRowUnit(1,"-");
- QString aUnitName = myField->myUnitNames[0].c_str();
+ QString aUnitName = GetField()->myUnitNames[0].c_str();
int aScalarMode = myCutLinesPL->GetScalarMode();
if(aScalarMode != 0)
- aUnitName = myField->myUnitNames[aScalarMode-1].c_str();
+ aUnitName = GetField()->myUnitNames[aScalarMode-1].c_str();
aUnitName = aUnitName.simplifyWhiteSpace();
if(aUnitName.isEmpty()) aUnitName = "-";
TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
explicit
CutLines_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
CutLines_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~CutLines_i();
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
//! Extends VISU_ColoredPrs3d_i::Create
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
//! Extends VISU_ColoredPrs3d_i::ToStream
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
- void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
+ void BuildTableOfReal(SALOMEDS::SObject_var theSObject);
static const std::string myComment;
int
VISU::CutPlanes_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//----------------------------------------------------------------------------
VISU::CutPlanes_i
::CutPlanes_i(Result_i* theResult,
- bool theAddToStudy):
+ EPublishInStudyMode thePublishInStudyMode):
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
myCutPlanesPL(NULL)
{}
//----------------------------------------------------------------------------
VISU::CutPlanes_i
::CutPlanes_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject):
+ SALOMEDS::SObject_var theSObject):
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//----------------------------------------------------------------------------
VISU::Storable*
VISU::CutPlanes_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::CutPlanes_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
//----------------------------------------------------------------------------
explicit
CutPlanes_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
CutPlanes_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~CutPlanes_i();
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
//! Redefines VISU_ColoredPrs3d_i::Create
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
//! Redefines VISU_ColoredPrs3d_i::ToStream
int
VISU::DeformedShape_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//---------------------------------------------------------------
VISU::DeformedShape_i
::DeformedShape_i(Result_i* theResult,
- bool theAddToStudy):
+ EPublishInStudyMode thePublishInStudyMode):
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
myDeformedShapePL(NULL)
{
if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
//---------------------------------------------------------------
VISU::DeformedShape_i
::DeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject):
+ SALOMEDS::SObject_var theSObject):
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::DeformedShape_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
myIsColored = false;
VISU::DeformedShape_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
explicit
DeformedShape_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
DeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
void
SameAs(const Prs3d_i* theOrigin);
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
static const std::string myComment;
break;
}
- CORBA::String_var aMeshName = theServant->GetMeshName();
- CORBA::String_var aFieldName = theServant->GetFieldName();
theStr<<thePrefix<<theName<<" = aVisu."<<theConstructorName<<"("<<theArgumentName<<
- ",'"<<aMeshName.in()<<"'"<<
+ ",'"<<theServant->GetCMeshName()<<"'"<<
","<<aParam<<
- ",'"<<aFieldName.in()<<"'"<<
+ ",'"<<theServant->GetCFieldName()<<"'"<<
","<<theServant->GetTimeStampNumber()<<
")"<<endl;
if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
VISU::Entity anEntity = aServant->GetEntity();
const std::string& aSubMeshName = aServant->GetSubMeshName();
- CORBA::String_var aMeshName = aServant->GetMeshName();
if(anEntity >= 0){
std::string aParam;
switch(anEntity){
if(aSubMeshName == "")
theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
- ",'"<<aMeshName.in()<<"'"<<
+ ",'"<<aServant->GetCMeshName()<<"'"<<
","<<aParam<<
")"<<endl;
else
theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
- ",'"<<aMeshName.in()<<"'"<<
+ ",'"<<aServant->GetCMeshName()<<"'"<<
","<<aParam<<
",'"<<aSubMeshName<<"'"<<
")"<<endl;
}else
theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
- ",'"<<aMeshName.in()<<"'"<<
+ ",'"<<aServant->GetCMeshName()<<"'"<<
",'"<<aSubMeshName<<"'"<<
")"<<endl;
int
VISU::GaussPoints_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theIteration,
int isMemoryCheck)
{
//----------------------------------------------------------------------------
VISU::GaussPoints_i::
GaussPoints_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
myGaussPointsPL(NULL),
myColor(Qt::blue),
myIsActiveLocalScalarBar(true),
//----------------------------------------------------------------------------
VISU::GaussPoints_i::
GaussPoints_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//----------------------------------------------------------------------------
VISU::Storable*
VISU::GaussPoints_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theIteration)
{
TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
VISU::GaussPoints_i
::DoSetInput()
{
- VISU::Result_i::TInput* anInput = myResult->GetInput();
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
if(!anInput)
throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
- myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
- if(!myField)
+ SetField(anInput->GetField(GetCMeshName(),GetTEntity(),GetCFieldName()));
+ if(!GetField())
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
- anInput->GetTimeStampOnGaussPts(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
+ anInput->GetTimeStampOnGaussPts(GetCMeshName(),GetTEntity(),GetCFieldName(),GetTimeStampNumber());
if(!aGaussPtsIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
- myGaussPointsPL->SetGaussPtsIDMapper(aGaussPtsIDMapper);
- myGaussPointsPL->Init();
- myGaussPointsPL->Build();
+ GetSpecificPL()->SetGaussPtsIDMapper(aGaussPtsIDMapper);
+ GetSpecificPL()->Init();
+ GetSpecificPL()->Build();
- myResult->MinMaxConnect(this);
+ GetCResult()->MinMaxConnect(this);
}
VISU::GaussPoints_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
::UpdateScalarBar(vtkScalarBarActor *theScalarBar,
vtkLookupTable* theLookupTable)
{
- theScalarBar->SetTitle(myTitle.c_str());
- theScalarBar->SetOrientation(myOrientation);
- theScalarBar->SetNumberOfLabels(myNumberOfLabels);
+ theScalarBar->SetTitle(GetCTitle().c_str());
+ theScalarBar->SetOrientation(GetBarOrientation());
+ theScalarBar->SetNumberOfLabels(GetLabels());
vtkLookupTable* aLookupTable = GetSpecificPL()->GetBarTable();
theLookupTable->SetNumberOfColors(aLookupTable->GetNumberOfColors());
theScalarBar->SetMaximumNumberOfColors(aLookupTable->GetNumberOfColors());
+ vtkFloatingPointType anRGB[3];
+
vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
- aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
- (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
- (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
- (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+ aTitleProp->SetFontFamily(GetTitFontType());
+
+ GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+ aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+ IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+ IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
- aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
- (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
- (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
- (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+ aLabelProp->SetFontFamily(GetLblFontType());
+
+ GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+ aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+ IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+ IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
theScalarBar->Modified();
}
TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
bool anIsMinMaxDone = IsGlobalRangeDefined();
if(anIsMinMaxDone)
- aTMinMax = myField->GetMinMax(GetScalarMode());
+ aTMinMax = GetField()->GetMinMax(GetScalarMode());
aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
aScalarBarCtrl->SetMode(aScalarBarMode);
// Position
- aScalarBarCtrl->SetWidth(myWidth);
- aScalarBarCtrl->SetHeight(myHeight);
- aScalarBarCtrl->SetPosition(myPosition);
+ aScalarBarCtrl->SetWidth(GetWidth());
+ aScalarBarCtrl->SetHeight(GetHeight());
+
+ vtkFloatingPointType aPosition[] = {GetPosX(), GetPosY()};
+ aScalarBarCtrl->SetPosition(aPosition);
aScalarBarCtrl->SetSpacing(mySpacing);
VISU::GaussPoints_i
::IsGlobalRangeDefined() const
{
- return myResult->IsMinMaxDone();
+ return GetCResult()->IsMinMaxDone();
}
bool
explicit
GaussPoints_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
GaussPoints_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~GaussPoints_i();
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theIteration,
int isMemoryCheck = true);
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theIteration);
static const std::string myComment;
if(!theStudy->GetProperties()->IsLocked()){
typedef typename TPrs3d_i::TInterface TPrs3d;
typename TPrs3d::_var_type aPrs3d;
- if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,true)){
+ if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,ColoredPrs3d_i::EPublishIndependently)){
return aPresent->_this();
}
}
bool
CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
CORBA::Double theIteration)
{
#ifndef _DEXCEPT_
}
void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult,
- const char* theMeshName,
+ const char* theMeshName,
const char* theGroupName,
const char* theNewName)
{
const char* theFieldName,
CORBA::Double theIteration)
{
- return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
+ return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult,
const char* theFieldName,
CORBA::Double theIteration)
{
- return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
+ return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
}
DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult,
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
+#include "VISU_ColoredPrs3d_i.hh"
#include <string>
bool
CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
CORBA::Double theIteration);
class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
virtual
void
RenameGroupInStudy(Result_ptr theResult,
- const char* theMeshName,
+ const char* theMeshName,
const char* theGroupName,
const char* theNewName);
//Create 3D collored Presentation Of Different Types
template<typename TPrs3d_i> TPrs3d_i*
CreatePrs3d(Result_ptr theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration,
- bool theAddToStudy = true)
+ const std::string& theFieldName,
+ CORBA::Double theIteration)
{
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,theAddToStudy);
+ TPrs3d_i* aPresent = new TPrs3d_i(aResult);
if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
return aPresent;
aPresent->_remove_ref();
template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
Prs3dOnField(Result_ptr theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Double theIteration,
- bool theAddToStudy = true)
+ const std::string& theFieldName,
+ CORBA::Double theIteration)
{
typedef typename TPrs3d_i::TInterface TPrs3d;
typename TPrs3d::_var_type aPrs3d;
- if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,theAddToStudy))
+ if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration))
return aPrs3d->_this();
return TPrs3d::_nil();
}
int
VISU::IsoSurfaces_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//---------------------------------------------------------------
VISU::IsoSurfaces_i
::IsoSurfaces_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
myIsoSurfacesPL(NULL)
{}
//---------------------------------------------------------------
VISU::IsoSurfaces_i
::IsoSurfaces_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::IsoSurfaces_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::IsoSurfaces_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
//---------------------------------------------------------------
explicit
IsoSurfaces_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
IsoSurfaces_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~IsoSurfaces_i();
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
static const std::string myComment;
static int INCMEMORY = 4;
+//----------------------------------------------------------------------------
int VISU::Mesh_i::myNbPresent = 0;
-QString VISU::Mesh_i::GenerateName() { return VISU::GenerateName("Mesh",myNbPresent++);}
+//----------------------------------------------------------------------------
+QString
+VISU::Mesh_i
+::GenerateName()
+{
+ return VISU::GenerateName("Mesh",myNbPresent++);
+}
+//----------------------------------------------------------------------------
const string VISU::Mesh_i::myComment = "MESH";
-const char* VISU::Mesh_i::GetComment() const { return myComment.c_str();}
+//----------------------------------------------------------------------------
+const char*
+VISU::Mesh_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
-VISU::Mesh_i::
-Mesh_i(Result_i* theResult) :
+//----------------------------------------------------------------------------
+VISU::Mesh_i
+::Mesh_i(Result_i* theResult) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,false),
myMeshPL(VISU_MeshPL::New())
}
-VISU::Mesh_i::
-Mesh_i(Result_i* theResult,
+//----------------------------------------------------------------------------
+VISU::Mesh_i
+::Mesh_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
//---------------------------------------------------------------
-void VISU::Mesh_i::RemoveFromStudy()
+void
+VISU::Mesh_i
+::RemoveFromStudy()
{
struct TRemoveFromStudy: public SALOME_Event
{
}
-void VISU::Mesh_i::SameAs (const Prs3d_i* theOrigin)
+//----------------------------------------------------------------------------
+void
+VISU::Mesh_i
+::SameAs(const Prs3d_i* theOrigin)
{
return; // "SameAs" command for mesh is not valid in current architecture
}
-int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName,
- Entity theEntity, const char* theFamilyName)
+//----------------------------------------------------------------------------
+int
+VISU::Mesh_i
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ Entity theEntity,
+ const char* theFamilyName)
{
try{
MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
return 0;
}
-VISU::Storable* VISU::Mesh_i::Create (const char* theMeshName,
- Entity theEntity,
- const char* theFamilyName)
+VISU::Storable*
+VISU::Mesh_i
+::Create(const std::string& theMeshName,
+ Entity theEntity,
+ const char* theFamilyName)
{
- myMeshName = theMeshName;
- //jfa IPAL9284:myEntity = VISU::TEntity(theEntity);
+ SetMeshName(theMeshName.c_str());
myEntity = int(theEntity);//jfa IPAL9284
mySubMeshName = theFamilyName;
return Build(false);
}
-int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName, const char* theGroupName)
+int
+VISU::Mesh_i
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ const char* theGroupName)
{
try{
MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
}
-VISU::Storable* VISU::Mesh_i::Create (const char* theMeshName,
- const char* theGroupName)
+VISU::Storable*
+VISU::Mesh_i
+::Create(const std::string& theMeshName,
+ const char* theGroupName)
{
- myMeshName = theMeshName;
- //jfa IPAL9284:myEntity = VISU::TEntity(-1);
+ SetMeshName(theMeshName.c_str());
myEntity = -1;//jfa IPAL9284
mySubMeshName = theGroupName;
return Build(false);
}
-VISU::Storable* VISU::Mesh_i::Restore(const Storable::TRestoringMap& theMap)
+VISU::Storable*
+VISU::Mesh_i
+::Restore(const Storable::TRestoringMap& theMap)
{
Prs3d_i::Restore(theMap);
- myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
- //jfa IPAL9284:myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
+ SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
myEntity = VISU::Storable::FindValue(theMap,"myEntity").toInt();//jfa IPAL9284
mySubMeshName = VISU::Storable::FindValue(theMap,"mySubMeshName").latin1();
}
-void VISU::Mesh_i::ToStream(std::ostringstream& theStr){
+void
+VISU::Mesh_i
+::ToStream(std::ostringstream& theStr)
+{
Prs3d_i::ToStream(theStr);
- Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
+ Storable::DataToStream( theStr, "myMeshName", GetCMeshName() );
Storable::DataToStream( theStr, "myEntity", myEntity );
Storable::DataToStream( theStr, "mySubMeshName", mySubMeshName.c_str() );
}
-VISU::Mesh_i::~Mesh_i(){
+VISU::Mesh_i
+::~Mesh_i()
+{
if(MYDEBUG) MESSAGE("Mesh_i::~Mesh_i()");
}
-VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
+VISU::Storable*
+VISU::Mesh_i
+::Build(int theRestoring)
{
SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
try {
- if (myResult->GetInput() == NULL)
- throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
+ if (GetCResult()->GetInput() == NULL)
+ throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
if (!theRestoring) {
myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
if(myEntity == VISU::NODE_ENTITY)
QString aComment,aTmp;
VISU::PIDMapper anIDMapper;
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
switch(myType){
case VISU::TENTITY :
- anIDMapper = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
+ anIDMapper = anInput->GetMeshOnEntity(GetCMeshName(),
+ (VISU::TEntity)myEntity);//jfa IPAL9284
aComment = "";
aComment.append(aTmp.sprintf("myComment=ENTITY;myType=%d;",VISU::TENTITY));
- aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+ aComment.append("myMeshName=");
+ aComment.append(GetCMeshName().c_str());
+ aComment.append(";");
aComment.append(aTmp.sprintf("myId=%d",myEntity));
break;
case VISU::TFAMILY :
- anIDMapper = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
+ anIDMapper = anInput->GetFamilyOnEntity(GetCMeshName(),
+ (VISU::TEntity)myEntity,
+ mySubMeshName);
aComment = "";
aComment.append(aTmp.sprintf("myComment=FAMILY;myType=%d;",VISU::TFAMILY));
- aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
+ aComment.append("myMeshName=");
+ aComment.append(GetCMeshName().c_str());
+ aComment.append(";");
aComment.append(aTmp.sprintf("myEntityId=%d;",myEntity));
- aComment.append("myName=");aComment.append(mySubMeshName);
+ aComment.append("myName=");
+ aComment.append(mySubMeshName);
break;
case VISU::TGROUP :
- anIDMapper = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
+ anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(),
+ mySubMeshName);
aComment = "";
aComment.append(aTmp.sprintf("myComment=GROUP;myType=%d;",VISU::TGROUP));
- aComment.append("myMeshName=");aComment.append(myMeshName);aComment.append(";");
- aComment.append("myName=");aComment.append(mySubMeshName);
+ aComment.append("myMeshName=");
+ aComment.append(GetCMeshName().c_str());
+ aComment.append(";");
+ aComment.append("myName=");
+ aComment.append(mySubMeshName);
break;
}
if(!theRestoring) { //Setting IOR on the label
myMeshPL->Init();
- string aResultEntry = myResult->GetEntry();
- string anEntry = myResult->GetEntry(aComment.latin1());
+ string aResultEntry = GetCResult()->GetEntry();
+ string anEntry = GetCResult()->GetEntry(aComment.latin1());
if(anEntry == "")
throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
- mySObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
+ SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
- SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
+ SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aString = GetID();
anIOR->SetValue(aString);
+ SetSObject(aSObject);
}
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
}
-VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+VISU_Actor*
+VISU::Mesh_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
VISU_MeshAct* anActor = VISU_MeshAct::New();
try{
}
-void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) {
+void
+VISU::Mesh_i
+::UpdateActor(VISU_Actor* theActor)
+{
if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
if(MYDEBUG) MESSAGE("Mesh_i::UpdateActor");
VISU::Prs3d_i::UpdateActor(anActor);
struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName,
+ static int IsPossible(Result_i* theResult, const std::string& theMeshName,
Entity theEntity, const char* theFamilyName = "");
- virtual Storable* Create(const char* theMeshName, Entity theEntity, const char* theFamilyName = "");
+ virtual Storable* Create(const std::string& theMeshName, Entity theEntity, const char* theFamilyName = "");
- static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName);
- virtual Storable* Create(const char* theMeshName, const char* theGroupName);
+ static int IsPossible(Result_i* theResult, const std::string& theMeshName, const char* theGroupName);
+ virtual Storable* Create(const std::string& theMeshName, const char* theGroupName);
VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
const string& GetSubMeshName() const { return mySubMeshName;}
int
VISU::Plot3D_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//---------------------------------------------------------------
VISU::Plot3D_i
::Plot3D_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
myPlot3DPL(NULL)
{}
//---------------------------------------------------------------
VISU::Plot3D_i
::Plot3D_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::Plot3D_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::Plot3D_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
//---------------------------------------------------------------
explicit
Plot3D_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
Plot3D_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~Plot3D_i();
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
virtual
//----------------------------------------------------------------------------
VISU::Prs3d_i
-::Prs3d_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- mySObject(SALOMEDS::SObject::_duplicate(theSObject)),
+::Prs3d_i(Result_i* theResult) :
+ PrsObject_i(SALOMEDS::Study::_nil()),
myActorCollection(vtkActorCollection::New()),
- myAddToStudy(true),
+ mySObject(SALOMEDS::SObject::_nil()),
myResult(theResult),
myPipeLine(NULL)
{
//----------------------------------------------------------------------------
VISU::Prs3d_i
::Prs3d_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(SALOMEDS::Study::_nil()),
+ SALOMEDS::SObject_var theSObject) :
+ PrsObject_i(theSObject->GetStudy()),
+ mySObject(theSObject),
myActorCollection(vtkActorCollection::New()),
- mySObject(SALOMEDS::SObject::_nil()),
- myAddToStudy(theAddToStudy),
myResult(theResult),
myPipeLine(NULL)
{
VISU::Prs3d_i
::Apply()
{
- if(SetInput()){
- UpdateActors();
- return true;
+ try{
+ if(SetInput()){
+ UpdateActors();
+ return true;
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
}
return false;
}
}
+//----------------------------------------------------------------------------
+Result_i*
+VISU::Prs3d_i
+::GetCResult() const
+{
+ return myResult;
+}
+
+
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
}
+//----------------------------------------------------------------------------
+std::string
+VISU::Prs3d_i
+::GetCMeshName() const
+{
+ return myMeshName;
+}
+
+
//----------------------------------------------------------------------------
unsigned long int
VISU::Prs3d_i
return mySObject;
}
-Result_i*
+
+//----------------------------------------------------------------------------
+void
VISU::Prs3d_i
-::GetResult() const
-{
- return myResult;
+::SetSObject(SALOMEDS::SObject_var theSObject)
+{
+ mySObject = theSObject;
}
+
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
-::CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO)
+::CreateActor(VISU_Actor* theActor,
+ const Handle(SALOME_InteractiveObject)& theIO)
{
try{
Handle(SALOME_InteractiveObject) anIO = theIO;
//----------------------------------------------------------------------------
VISU::Result_i*
-VISU::GetResult(SALOMEDS::SObject_ptr theSObject)
+VISU::GetResult(SALOMEDS::SObject_var theSObject)
{
VISU::Result_var aResult = FindResult(theSObject);
if(!aResult->_is_nil())
return dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult.in()).in());
return NULL;
}
-
//----------------------------------------------------------------------------
//! A constructor to create a fresh instance of the class
explicit
- Prs3d_i(Result_i* theResult,
- bool theAddToStudy);
+ Prs3d_i(Result_i* theResult);
//! A constructor to restore an instance of the class
explicit
Prs3d_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
//! To create a deep copy from another instance of the class
virtual
VISU::Result_ptr
GetResultObject();
+ //! Get corresponding Result_i
+ Result_i*
+ GetCResult() const;
+
virtual
void
SetMeshName(const char* theMeshName);
char*
GetMeshName();
+ std::string
+ GetCMeshName() const;
+
//----------------------------------------------------------------------------
//! To generate an unique type name for the class (used into persistent functionality)
virtual
ToStream(std::ostringstream& theStr);
//----------------------------------------------------------------------------
- //! Get corresponding Result_i
- Result_i*
- GetResult() const;
-
//! Get corresponding SALOMEDS::SObject
virtual
SALOMEDS::SObject_var
void
CheckDataSet();
+ void
+ SetSObject(SALOMEDS::SObject_var theSObject);
+
protected:
vtkTimeStamp myUpdateTime;
+ vtkTimeStamp myParamsTime;
+ private:
Result_i *myResult;
std::string myMeshName;
CORBA::Float myOffset[3];
- vtkTimeStamp myParamsTime;
SALOMEDS::SObject_var mySObject;
- bool myAddToStudy;
boost::signal0<void> myUpdateActorsSignal;
boost::signal0<void> myRemoveActorsFromRendererSignal;
vtkSmartPointer<vtkActorCollection> myActorCollection;
- private:
VISU_PipeLine *myPipeLine;
};
//----------------------------------------------------------------------------
Result_i*
- GetResult(SALOMEDS::SObject_ptr theSObject);
+ GetResult(SALOMEDS::SObject_var theSObject);
//----------------------------------------------------------------------------
template<class TPrs3d>
const std::string& thePrefix,
const Storable::TRestoringMap& theMap)
{
- VISU::Result_i* pResult = GetResult(theSObject);
- if(pResult != NULL){
- TPrs3d* pPrs3d = new TPrs3d(pResult,theSObject);
- return pPrs3d->Restore(theMap);
+ if(VISU::Result_i* aResult = GetResult(theSObject)){
+ SALOMEDS::SObject_var aSObject = SALOMEDS::SObject::_duplicate(theSObject);
+ TPrs3d* aPrs3d = new TPrs3d(aResult,aSObject);
+ return aPrs3d->Restore(theMap);
}
return NULL;
}
//---------------------------------------------------------------
void
VISU::PrsObject_i
-::SetName(const char* theName)
+::SetName(const std::string& theName)
{
myName = theName;
SALOMEDS::SObject_var aSObject = myStudy->FindObjectID( GetEntry() );
SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
- aNameAttr->SetValue( theName );
+ aNameAttr->SetValue( theName.c_str() );
}
}
virtual
void
- SetName(const char* theName);
+ SetName(const std::string& theName);
const SALOMEDS::Study_var&
GetStudyDocument() const;
//---------------------------------------------------------------
QString
- GenerateName (const char* theName)
+ GenerateName (const std::string& theName)
{
TLock aLock(myMutex);
int
VISU::ScalarMapOnDeformedShape_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
bool aResult = false;
try{
- aResult = VISU::ScalarMap_i::IsPossible(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber,
- false);
+ aResult = TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ false);
if(isMemoryCheck && aResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
const VISU::PField aField = anInput->GetField(theMeshName,
//---------------------------------------------------------------
VISU::ScalarMapOnDeformedShape_i
::ScalarMapOnDeformedShape_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
myScalarMapOnDeformedShapePL(NULL),
myScalarIteration(1)
{}
//---------------------------------------------------------------
VISU::ScalarMapOnDeformedShape_i
::ScalarMapOnDeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject):
+ SALOMEDS::SObject_var theSObject):
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::ScalarMapOnDeformedShape_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
myIsColored = true;
VISU::ScalarMapOnDeformedShape_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
-::SetScalarField(const char* theMeshName,
- const char* theFieldName,
+::SetScalarField(const std::string& theMeshName,
+ const std::string& theFieldName,
int theIteration,
VISU::TEntity theEntity)
{
- VISU::Result_i::TInput* anInput = myResult->GetInput();
- myScalarField = anInput->GetField(theMeshName,theEntity,theFieldName);
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ SetField(anInput->GetField(theMeshName,theEntity,theFieldName));
VISU::PIDMapper anIDMapper = anInput->GetTimeStampOnMesh(theMeshName,
theEntity,
theFieldName,
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
-::SetScalarMeshName(const char* theName)
+::SetScalarMeshName(const std::string& theName)
{
if(myScalarMeshName != theName){
myScalarMeshName = theName;
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
-::SetScalarFieldName(const char* theName)
+::SetScalarFieldName(const std::string& theName)
{
if(myScalarFieldName != theName){
myScalarFieldName = theName;
{
return VISU::Entity(myScalarEntity);
}
-
-//---------------------------------------------------------------
-const VISU::PField&
-VISU::ScalarMapOnDeformedShape_i
-::GetField() const
-{
- return myScalarField;
-}
explicit
ScalarMapOnDeformedShape_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
ScalarMapOnDeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual ~ScalarMapOnDeformedShape_i();
void
SameAs(const Prs3d_i* theOrigin);
- virtual const VISU::PField&
- GetField() const;
-
typedef VISU::ScalarMapOnDeformedShape TInterface;
VISU_ScalarMapOnDeformedShapePL*
std::string myScalarFieldName;
VISU::TEntity myScalarEntity;
int myScalarIteration;
- PField myScalarField;
public:
//! Redefines VISU_ColoredPrs3d_i::IsPossible
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
//! Redefines VISU_ColoredPrs3d_i::IsPossible
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
//! Redefines VISU_ColoredPrs3d_i::ToStream
virtual
void
- SetScalarField(const char* theMeshName,
- const char* theFieldName,
+ SetScalarField(const std::string& theMeshName,
+ const std::string& theFieldName,
int theIteration,
VISU::TEntity theEntity);
virtual
void
- SetScalarFieldName(const char* theName);
+ SetScalarFieldName(const std::string& theName);
virtual
std::string
virtual
void
- SetScalarMeshName(const char* theName);
+ SetScalarMeshName(const std::string& theName);
virtual
std::string
int
VISU::ScalarMap_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//----------------------------------------------------------------------------
VISU::ScalarMap_i::
ScalarMap_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy)
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode)
{}
//----------------------------------------------------------------------------
VISU::ScalarMap_i::
ScalarMap_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject)
ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
SetRange(anOrigin->GetMin(), anOrigin->GetMax());
- myIsFixedRange = anOrigin->IsRangeFixed();
+ UseFixedRange(anOrigin->IsRangeFixed());
SetScaling(anOrigin->GetScaling());
*/
VISU::Storable*
VISU::ScalarMap_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
// Scalar Range
int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
- myIsFixedRange = (aRangeType == 1) ? true : false;
-
- if(myIsFixedRange){
+ if(aRangeType == 1){
float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
SetRange(aMin,aMax);
}
+ UseFixedRange((aRangeType == 1) ? true : false);
bool isLog = aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false);
if( isLog )
float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
SetRange(aMin,aMax);
- myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
+ UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt());
return this;
}
Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
- Storable::DataToStream( theStr, "myIsFixedRange", myIsFixedRange );
+ Storable::DataToStream( theStr, "myIsFixedRange", IsRangeFixed() );
Storable::DataToStream( theStr, "myScaling", GetScaling() );
}
VISU::ScalarMap_i
::GetScaling()
{
- return VISU::Scaling(myScalarMapPL->GetScaling());
+ return VISU::Scaling(GetSpecificPL()->GetScaling());
}
//----------------------------------------------------------------------------
VISU::ScalarMap_i
::SetScaling(VISU::Scaling theScaling)
{
- myScalarMapPL->SetScaling(theScaling);
+ GetSpecificPL()->SetScaling(theScaling);
}
//----------------------------------------------------------------------------
if(theMin > theMax)
return;
vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
- myScalarMapPL->SetScalarRange(aScalarRange);
- myIsFixedRange = true;
+ GetSpecificPL()->SetScalarRange(aScalarRange);
+ UseFixedRange(true);
}
VISU::ScalarMap_i
::DoSetInput()
{
- VISU::Result_i::TInput* anInput = myResult->GetInput();
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
if(!anInput)
- throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
+ throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
- myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
- if(!myField)
+ SetField(anInput->GetField(GetCMeshName(),GetTEntity(),GetCFieldName()));
+ if(!GetField())
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PIDMapper anIDMapper =
- anInput->GetTimeStampOnMesh(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
+ anInput->GetTimeStampOnMesh(GetCMeshName(),GetTEntity(),GetCFieldName(),GetTimeStampNumber());
if(!anIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
- myScalarMapPL->SetIDMapper(anIDMapper);
- myScalarMapPL->Init();
- myScalarMapPL->Build();
+ GetSpecificPL()->SetIDMapper(anIDMapper);
+ GetSpecificPL()->Init();
+ GetSpecificPL()->Build();
}
VISU::ScalarMap_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
VISU::ScalarMap_i
::SetMapScale(double theMapScale)
{
- myScalarMapPL->SetMapScale(theMapScale);
-}
-
-//----------------------------------------------------------------------------
-bool
-VISU::ScalarMap_i
-::IsRangeFixed()
-{
- return myIsFixedRange;
+ GetSpecificPL()->SetMapScale(theMapScale);
}
//----------------------------------------------------------------------------
VISU::ScalarMap_i
::SetSourceRange()
{
- myScalarMapPL->SetSourceRange();
- myIsFixedRange = false;
+ GetSpecificPL()->SetSourceRange();
+ UseFixedRange(false);
}
//----------------------------------------------------------------------------
{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
- aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
- aScalarBar->SetTitle(myTitle.c_str());
- aScalarBar->SetOrientation(myOrientation);
+ aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
+ aScalarBar->SetTitle(GetCTitle().c_str());
+ aScalarBar->SetOrientation(GetBarOrientation());
aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
- aScalarBar->GetPositionCoordinate()->SetValue(myPosition[0],myPosition[1]);
- aScalarBar->SetWidth(myWidth);
- aScalarBar->SetHeight(myHeight);
- aScalarBar->SetNumberOfLabels(myNumberOfLabels);
+ aScalarBar->GetPositionCoordinate()->SetValue(GetPosX(),GetPosY());
+ aScalarBar->SetWidth(GetWidth());
+ aScalarBar->SetHeight(GetHeight());
+ aScalarBar->SetNumberOfLabels(GetLabels());
+
+ vtkFloatingPointType anRGB[3];
vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
- aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
- (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
- (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
- (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+ aTitleProp->SetFontFamily(GetTitFontType());
+
+ GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+ aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+ IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+ IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
- aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
- (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
- (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
- (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+ aLabelProp->SetFontFamily(GetLblFontType());
+
+ GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+ aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+
+ IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+ IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+ IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
aScalarBar->Modified();
}
explicit
ScalarMap_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
ScalarMap_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
~ScalarMap_i();
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
//! Redefines VISU_ColoredPrs3d_i::Create
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
virtual
void
SetMapScale(double theMapScale = 1.0);
- virtual
- bool
- IsRangeFixed();
-
virtual
void
SetSourceRange();
int
VISU::StreamLines_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//---------------------------------------------------------------
VISU::StreamLines_i
::StreamLines_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
- DeformedShape_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
+ DeformedShape_i(theResult,thePublishInStudyMode),
myStreamLinesPL(NULL),
myAppendFilter(vtkAppendFilter::New())
{}
//---------------------------------------------------------------
VISU::StreamLines_i
::StreamLines_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::StreamLines_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::StreamLines_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
explicit
StreamLines_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
StreamLines_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
void
static
int
IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
//! Extends VISU_ColoredPrs3d_i::Create
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
//! Extends VISU_ColoredPrs3d_i::ToStream
VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
{
if(MYDEBUG) MESSAGE(GetComment());
- myName = (const char*)(VISU::Storable::FindValue(theMap,"myName"));
- myTitle = (const char*)(VISU::Storable::FindValue(theMap,"myTitle"));
+ myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+ myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
mySObj = SALOMEDS::SObject::_duplicate(SO);
return Build( true );
virtual ~Table_i();
virtual VISU::VISUType GetType() { return VISU::TTABLE;};
- virtual void SetTitle( const char* theName ) { SetName( theName ); }
+ virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
virtual ~Curve_i();
virtual VISU::VISUType GetType() { return VISU::TCURVE;};
- virtual void SetTitle( const char* theName ) { SetName( theName ); }
+ virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
int
VISU::Vectors_i
::IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck)
{
//---------------------------------------------------------------
VISU::Vectors_i
::Vectors_i(Result_i* theResult,
- bool theAddToStudy) :
+ EPublishInStudyMode thePublishInStudyMode) :
PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(theResult,theAddToStudy),
- ColoredPrs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
- DeformedShape_i(theResult,theAddToStudy),
+ Prs3d_i(theResult),
+ ColoredPrs3d_i(theResult,thePublishInStudyMode),
+ ScalarMap_i(theResult,thePublishInStudyMode),
+ DeformedShape_i(theResult,thePublishInStudyMode),
myLineWidth(1.0),
myVectorsPL(NULL)
{}
//---------------------------------------------------------------
VISU::Vectors_i
::Vectors_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_var theSObject) :
PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
//---------------------------------------------------------------
VISU::Storable*
VISU::Vectors_i
-::Create(const char* theMeshName,
+::Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::Vectors_i
::CheckIsPossible()
{
- return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
}
//---------------------------------------------------------------
explicit
Vectors_i(Result_i* theResult,
- bool theAddToStudy);
+ EPublishInStudyMode thePublishInStudyMode = EPublishUnderTimeStamp);
explicit
Vectors_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ SALOMEDS::SObject_var theSObject);
virtual
void
//! Redefines VISU_ColoredPrs3d_i::IsPossible
static
int IsPossible(Result_i* theResult,
- const char* theMeshName,
+ const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber,
int isMemoryCheck = true);
//! Redefines VISU_ColoredPrs3d_i::Create
virtual
Storable*
- Create(const char* theMeshName,
+ Create(const std::string& theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const std::string& theFieldName,
int theTimeStampNumber);
//! Redefines VISU_ColoredPrs3d_i::ToStream
ProcessVoidEvent(new TEvent(aViewWindow));
}
- bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const char* theName)
+ bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const std::string& theName)
{
MESSAGE("View3D_i::SaveViewParams()");
- if (!theViewManager || !theName)
+ if (!theViewManager || theName == "")
return false;
_PTR(Study) aCStudy;
if (!aCStudy)
return false;
- if (strcmp(theName, "") != 0) {
- std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName, "VISU");
+ if (theName != "") {
+ std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName.c_str(), "VISU");
_PTR(GenericAttribute) anAttr;
int iEnd = aList.size();
for (int i = 0; i < iEnd; i++) {
}
_PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
string aSComponentEntry = aSComponent->GetID();
- string anEntry = CreateAttributes(aCStudy, aSComponentEntry.c_str(), "", "", theName, "",
+ string anEntry = CreateAttributes(aCStudy,
+ aSComponentEntry.c_str(),
+ "",
+ "",
+ theName,
+ "",
ToString(theViewManager->getActiveView()).c_str());
return true;
}
class TSaveViewParamsEvent: public SALOME_Event
{
SUIT_ViewManager* myViewMgr;
- const char* myName;
+ std::string myName;
public:
TSaveViewParamsEvent (SUIT_ViewManager* theViewManager,
- const char* theName):
+ const std::string& theName):
myViewMgr(theViewManager),
myName(theName)
{}
TResult myResult;
};
- CORBA::Boolean View3D_i::SaveViewParams (const char* theName)
+ CORBA::Boolean View3D_i::SaveViewParams (const char* theViewParamsName)
{
- return ProcessEvent(new TSaveViewParamsEvent (myViewManager, theName));
+ return ProcessEvent(new TSaveViewParamsEvent (myViewManager, theViewParamsName));
}
- bool View3D_i::RestoreViewParams (SUIT_ViewManager* theViewManager, const char* theName)
+ bool View3D_i::RestoreViewParams (SUIT_ViewManager* theViewManager, const std::string& theName)
{
_PTR(Study) aCStudy;
if (SUIT_Study* aSStudy = theViewManager->study()) {
class TRestoreViewParamsEvent: public SALOME_Event
{
SUIT_ViewManager* myViewMgr;
- const char* myName;
+ std::string myName;
public:
TRestoreViewParamsEvent (SUIT_ViewManager* theViewManager,
- const char* theName):
+ const std::string& theName):
myViewMgr(theViewManager),
myName(theName)
{}
TResult myResult;
};
- CORBA::Boolean View3D_i::RestoreViewParams (const char* theName)
+ CORBA::Boolean View3D_i::RestoreViewParams (const char* theViewParamsName)
{
- return ProcessEvent(new TRestoreViewParamsEvent (myViewManager, theName));
+ return ProcessEvent(new TRestoreViewParamsEvent (myViewManager, theViewParamsName));
}
void View3D_i::Restore (SUIT_ViewWindow* theViewWindow,
static void ToStream (SUIT_ViewWindow* theViewWindow, std::ostringstream& theStr);
static bool SaveViewParams (SUIT_ViewManager* theViewManager,
- const char* theName);
- virtual CORBA::Boolean SaveViewParams (const char* theName);
+ const std::string& theName);
+ virtual CORBA::Boolean SaveViewParams (const char* theViewParamsName);
static bool RestoreViewParams (SUIT_ViewManager* theViewManager,
- const char* theName);
- virtual CORBA::Boolean RestoreViewParams (const char* theName);
+ const std::string& theName);
+ virtual CORBA::Boolean RestoreViewParams (const char* theViewParamsName);
static QString GenerateViewParamsName();