//---------------------------------------------------------------
void
VISU::CutLinesBase_i
-::BuildTableOfReal(SALOMEDS::SObject_var theSObject)
+::BuildTableOfReal(SALOMEDS::SObject_var theSObject, bool theIsCutSegment)
{
try{
if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
int iEnd = aXCont.size();
aTableOfReal->SetNbColumns(iEnd);
TXCont::const_iterator aXContIter = aXCont.begin();
+ vtkFloatingPointType aMinDist = *aXContIter;
+ aXContIter = aXCont.end();
+ aXContIter--;
+ vtkFloatingPointType aMaxDist = *aXContIter;
+ if(aMaxDist <= aMinDist)
+ throw std::runtime_error("CutPlanes_i::BuildTableOfReal aMaxDist <= aMinDist !!!");
+ aXContIter = aXCont.begin();
for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){
vtkFloatingPointType aDist = *aXContIter;
- aTableOfReal->PutValue(aDist,1,i+1);
+ vtkFloatingPointType aXVal = aDist;
+ if(theIsCutSegment){
+ aXVal -= aMinDist;
+ if(!IsUseAbsoluteLength())
+ aXVal /= (aMaxDist - aMinDist);
+ }
+ aTableOfReal->PutValue(aXVal,1,i+1);
aString.sprintf("%d",i);
aTableOfReal->SetColumnTitle(i+1,(const char*)aString.toLatin1());
- if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<<aDist);
+ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal aDist = "<<aDist<<" aXVal = "<<aXVal);
TXYMapCont::const_iterator aXYMapContIter = aXYMapCont.begin();
for(; aXYMapContIter != aXYMapCont.end(); aXYMapContIter++){
long iLine = aXYMapContIter->first;
void
SameAs(const Prs3d_i* theOrigin);
- void BuildTableOfReal(SALOMEDS::SObject_var theSObject);
+ void BuildTableOfReal(SALOMEDS::SObject_var theSObject,
+ bool theIsCutSegment = false);
};
}
#include "VISU_PointMap3d_i.hh"
#include "VISU_CutLinesBase_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_ViewManager_i.hh"
#include "VISU_ScalarBarActor.hxx"
if(!CORBA::is_nil(anObj)){
VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
+ pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
}
SALOMEDS::Study_var aStudy = GetStudyDocument();
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
// look for component
if ( !theRestoring ) {
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
- // create SObject and set attributes
- QString aComment;
- if(pCutLines)
- aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
- else{
- aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
- SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
- if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
- SALOMEDS::AttributeString_var aCommentAttr =
- SALOMEDS::AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aCommentAttr->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if(anIsExist){
- if(aMethodName == "ImportTables"){
- aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
- }
- }
- }
- }
-
- string anEntry = CreateAttributes( GetStudyDocument(),
- SO->GetID(),//SComponent->GetID(),
- "ICON_TREE_TABLE",
- GetID(),
- GetName(),
- "",
- aComment.toLatin1().constData(),
- pCutLines );
- // create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
- if(pCutLines) {
- pCutLines->BuildTableOfReal(mySObj);
- }
- // mpv (PAL5357): reference attributes are unnecessary now
- //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
- //Builder->Addreference( refSO, SO );
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
+ // create SObject and set attributes
+ QString aComment;
+ if(pCutLines)
+ aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
+ else{
+ aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
+ SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
+ if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
+ SALOMEDS::AttributeString_var aCommentAttr =
+ SALOMEDS::AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aCommentAttr->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
+ if(anIsExist){
+ if(aMethodName == "ImportTables"){
+ aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
+ }
+ }
+ }
+ }
+
+ string anEntry = CreateAttributes( GetStudyDocument(),
+ SO->GetID(),//SComponent->GetID(),
+ "ICON_TREE_TABLE",
+ GetID(),
+ GetName(),
+ "",
+ aComment.toLatin1().constData(),
+ pCutLines );
+ // create SObject referenced to real table object
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
+ if(pCutLines) {
+ bool isCutSegment = dynamic_cast<CutSegment_i*>(pCutLines);
+ pCutLines->BuildTableOfReal(mySObj, isCutSegment);
+ }
+ // mpv (PAL5357): reference attributes are unnecessary now
+ //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+ //Builder->Addreference( refSO, SO );
}
return this;
#include "VISU_Table_i.hh"
#include "VISU_CutLinesBase_i.hh"
+#include "VISU_CutSegment_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_ViewManager_i.hh"
if(!CORBA::is_nil(anObj)){
VISU::CutLinesBase_var aCutLines = VISU::CutLinesBase::_narrow(anObj);
if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
+ pCutLines = dynamic_cast<CutLinesBase_i*>(GetServant(aCutLines).in());
}
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
// look for component
if ( !theRestoring ) {
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
- // create SObject and set attributes
- QString aComment;
- if(pCutLines)
- aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
- else{
- aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
- SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
- if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
- SALOMEDS::AttributeString_var aCommentAttr =
- SALOMEDS::AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aCommentAttr->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if(anIsExist){
- if( aMethodName == "ImportTables" ){
- aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
- }
- }
- }
- }
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
+ // create SObject and set attributes
+ QString aComment;
+ if(pCutLines)
+ aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
+ else{
+ aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
+ SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
+ if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
+ SALOMEDS::AttributeString_var aCommentAttr =
+ SALOMEDS::AttributeString::_narrow(anAttr);
+ CORBA::String_var aValue = aCommentAttr->Value();
+ Storable::TRestoringMap aMap;
+ Storable::StringToMap(aValue.in(),aMap);
+ bool anIsExist;
+ QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
+ if(anIsExist){
+ if( aMethodName == "ImportTables" ){
+ aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
+ }
+ }
+ }
+ }
- string anEntry = CreateAttributes( GetStudyDocument(),
- SO->GetID(),//SComponent->GetID(),
- "ICON_TREE_TABLE",
- GetID(),
- GetName(),
- "",
- aComment.toLatin1().data(),
- pCutLines );
- // create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
- if(pCutLines) {
- pCutLines->BuildTableOfReal(mySObj);
- }
- // mpv (PAL5357): reference attributes are unnecessary now
- //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
- //Builder->Addreference( refSO, SO );
+ string anEntry = CreateAttributes( GetStudyDocument(),
+ SO->GetID(),//SComponent->GetID(),
+ "ICON_TREE_TABLE",
+ GetID(),
+ GetName(),
+ "",
+ aComment.toLatin1().data(),
+ pCutLines );
+ // create SObject referenced to real table object
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
+ if(pCutLines) {
+ bool isCutSegment = dynamic_cast<CutSegment_i*>(pCutLines);
+ pCutLines->BuildTableOfReal(mySObj, isCutSegment);
+ }
+ // mpv (PAL5357): reference attributes are unnecessary now
+ //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+ //Builder->Addreference( refSO, SO );
}
return this;