//----------------------------------------------------------------------------
+template<unsigned int colored_prs3d_type_enum>
int
-VISU::ColoredPrs3dCache_i
-::IsPossible(VISU::VISUType theType,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
- //cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
std::string aMeshName = theInput.myMeshName.in();
VISU::Entity anEntity = theInput.myEntity;
std::string aFieldName = theInput.myFieldName.in();
- long aTimeStampNumber = theInput.myTimeStampNumber;
-
- bool ok = 0;
- switch( theType ){
- case TSCALARMAP: ok = VISU::ScalarMap_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TISOSURFACE: ok = VISU::IsoSurfaces_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TDEFORMEDSHAPE: ok = VISU::DeformedShape_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TSCALARMAPONDEFORMEDSHAPE: ok = VISU::ScalarMapOnDeformedShape_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TGAUSSPOINTS: ok = VISU::GaussPoints_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TPLOT3D: ok = VISU::Plot3D_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TCUTPLANES: ok = VISU::CutPlanes_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TCUTLINES: ok = VISU::CutLines_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TVECTORS: ok = VISU::Vectors_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- case TSTREAMLINES: ok = VISU::StreamLines_i::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
- break;
- default: break;
+ CORBA::Long aTimeStampNumber = theInput.myTimeStampNumber;
+
+ typedef typename VISU::TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
+ return TColoredPrs3d::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
+}
+
+//----------------------------------------------------------------------------
+int
+VISU::ColoredPrs3dCache_i
+::IsPossible(VISU::VISUType theType,
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+{
+ //cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
+ switch(theType){
+ case TSCALARMAP:
+ return CheckIsPossible<TSCALARMAP>(theInput);
+ case TGAUSSPOINTS:
+ return CheckIsPossible<TGAUSSPOINTS>(theInput);
+ case TDEFORMEDSHAPE:
+ return CheckIsPossible<TDEFORMEDSHAPE>(theInput);
+ case TSCALARMAPONDEFORMEDSHAPE:
+ return CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput);
+ case TISOSURFACE:
+ return CheckIsPossible<TISOSURFACE>(theInput);
+ case TSTREAMLINES:
+ return CheckIsPossible<TSTREAMLINES>(theInput);
+ case TPLOT3D:
+ return CheckIsPossible<TPLOT3D>(theInput);
+ case TCUTPLANES:
+ return CheckIsPossible<TCUTPLANES>(theInput);
+ case TCUTLINES:
+ return CheckIsPossible<TCUTLINES>(theInput);
+ case TVECTORS:
+ return CheckIsPossible<TVECTORS>(theInput);
}
- //cout << "returned " << ok << endl;
- return ok;
+ return 0;
}
if(IsPossible(theType, theInput))
{
VISU::ColoredPrs3dHolder_i* aHolder = new VISU::ColoredPrs3dHolder_i(theType, theInput, *this);
- CreatePrs(theType, theInput, aHolder);
+ VISU::ColoredPrs3d_i* aColoredPrs3d = CreateColoredPrs3d(theType, theInput);
+ std::string aComment = std::string("myComment=") + aColoredPrs3d->GetComment();
+ std::string aName = aColoredPrs3d->GenerateName().latin1();
+ aHolder->PublishInStudy(aName, aComment);
+ RegisterInHolder(aColoredPrs3d, aHolder);
return aHolder->_this();
}
return VISU::ColoredPrs3dHolder::_nil();
VISU::ColoredPrs3dCache_i
::GetFolderName()
{
- return "Cache";
+ return "3D Cache System";
}
void
//----------------------------------------------------------------------------
VISU::ColoredPrs3d_i*
VISU::ColoredPrs3dCache_i
-::CreatePrs(VISU::VISUType theType,
- VISU::ColoredPrs3dHolder::BasicInput theInput,
- VISU::ColoredPrs3dHolder_i* theHolder)
+::CreateColoredPrs3d(VISU::VISUType theType,
+ VISU::ColoredPrs3dHolder::BasicInput theInput)
{
VISU::ColoredPrs3d_i* aPrs3d = VISU::CreatePrs3d_i(theType, GetStudyDocument(), ColoredPrs3d_i::ERegisterInCache);
- aPrs3d->SetHolderEntry( theHolder->GetEntry() );
aPrs3d->SetResultObject( theInput.myResult );
aPrs3d->SetMeshName( theInput.myMeshName );
aPrs3d->SetEntity( theInput.myEntity );
aPrs3d->SetFieldName( theInput.myFieldName );
aPrs3d->SetTimeStampNumber( theInput.myTimeStampNumber );
aPrs3d->Apply();
-
- GetLastVisitedPrsList(theHolder).push_back(aPrs3d);
-
return aPrs3d;
}
+//----------------------------------------------------------------------------
+VISU::ColoredPrs3d_i*
+VISU::ColoredPrs3dCache_i
+::RegisterInHolder(VISU::ColoredPrs3d_i* thePrs3d,
+ VISU::ColoredPrs3dHolder_i* theHolder)
+{
+ thePrs3d->SetHolderEntry( theHolder->GetEntry() );
+ GetLastVisitedPrsList(theHolder).push_back(thePrs3d);
+ return thePrs3d;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::ColoredPrs3d_i*
+VISU::ColoredPrs3dCache_i
+::CreatePrs(VISU::VISUType theType,
+ VISU::ColoredPrs3dHolder::BasicInput theInput,
+ VISU::ColoredPrs3dHolder_i* theHolder)
+{
+ return RegisterInHolder(CreateColoredPrs3d(theType, theInput), theHolder);
+}
+
+
//----------------------------------------------------------------------------
VISU::TLastVisitedPrsList&
VISU::ColoredPrs3dCache_i
myCache(theCache)
{
if(MYDEBUG) MESSAGE("ColoredPrs3dHolder_i::ColoredPrs3dHolder_i - this = "<<this);
-
- QString aType;
- switch( theType ){
- case TSCALARMAP: aType = "SCALARMAP"; break;
- case TISOSURFACE: aType = "ISOSURFACES"; break;
- case TDEFORMEDSHAPE: aType = "DEFORMEDSHAPE"; break;
- case TSCALARMAPONDEFORMEDSHAPE: aType = "SCALARMAPONDEFORMEDSHAPE"; break;
- case TGAUSSPOINTS: aType = "GAUSSPOINTS"; break;
- case TPLOT3D: aType = "PLOT3D"; break;
- case TCUTPLANES: aType = "CUTPLANES"; break;
- case TCUTLINES: aType = "CUTLINES"; break;
- case TVECTORS: aType = "VECTORS"; break;
- case TSTREAMLINES: aType = "STREAMLINES"; break;
- default: break;
- }
-
- SetName(GenerateName().latin1(), false);
- CORBA::String_var anIOR = GetID();
- std::string aFatherEntry = theCache.GetEntry();
- QString aComment = QString("myComment=") + aType;
- CreateAttributes(GetStudyDocument(), aFatherEntry, "", anIOR.in(), GetName(), "", aComment, true);
}
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dHolder_i
+::PublishInStudy(const std::string& theName,
+ const std::string& theComment)
+{
+ SetName(theName, false);
+ CORBA::String_var anIOR = GetID();
+ std::string aFatherEntry = myCache.GetEntry();
+ CreateAttributes(GetStudyDocument(), aFatherEntry, "", anIOR.in(), GetName(), "", theComment, true);
+}
+
//----------------------------------------------------------------------------
CORBA::Boolean
VISU::ColoredPrs3dHolder_i