/*!
Generate unique name
*/
-const char* VISU::Table_i::GenerateName()
+QString VISU::Table_i::GenerateName()
{
return VISU::GenerateName( "Table", ++myNbPresent );
}
VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry )
: PrsObject_i(theStudy)
{
- mySObj = SALOMEDS::SObject::_duplicate((theStudy->FindObjectID(theObjectEntry)));
+ mySObj = theStudy->FindObjectID(theObjectEntry);
myOrientation = VISU::Table::HORIZONTAL;
}
/*!
}
//----------------------------------------------------------------------------
-char*
+std::string
VISU::Table_i
::GetObjectEntry()
{
- return CORBA::string_dup( mySObj->GetID() );
+ CORBA::String_var anEntry = mySObj->GetID();
+ return anEntry.in();
}
//----------------------------------------------------------------------------
VISU::Storable* VISU::Table_i::Create()
{
// generate name ...
- SetName(GetTableTitle(), false);
+ SetName(GetTableTitle().latin1(), false);
// mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
if ( GetName() == "" )
}
if ( GetName() == "" )
- SetName(GenerateName(), false);
+ SetName(GenerateName().latin1(), false);
// ... and build the object
return Build( false );
}
/*!
Gets title for the original table object
*/
-const char* VISU::Table_i::GetTableTitle()
+QString VISU::Table_i::GetTableTitle()
{
SALOMEDS::SObject_var SO = mySObj;
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
if ( !SO->_is_nil() ) {
if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
- return anInt->GetTitle();
+ CORBA::String_var aString = anInt->GetTitle();
+ return aString.in();
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
- return aReal->GetTitle();
+ CORBA::String_var aString = aReal->GetTitle();
+ return aString.in();
}
}
return "";
/*!
Generate unique name
*/
-const char* VISU::Curve_i::GenerateName()
+QString VISU::Curve_i::GenerateName()
{
return VISU::GenerateName( "Curve", ++myNbPresent );
}
CORBA::Boolean VISU::Curve_i::IsValid()
{
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
{
string title;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
{
string title;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
{
string units;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
{
string units;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
{
theHorList = 0; theVerList = 0;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
CORBA::String_var aString = mySObj->GetID();
crv->setIO(new SALOME_InteractiveObject(aString.in(), "VISU", GetName().c_str()));
if ( myTable )
- crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(), "VISU", myTable->GetName().c_str()));
+ crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry().c_str(), "VISU", myTable->GetName().c_str()));
return crv;
}
/*!
/*!
Gets reference table's entry
*/
-const char* VISU::Curve_i::GetTableID() {
+std::string VISU::Curve_i::GetTableID() {
return myTable->GetObjectEntry();
}
/*!
/*!
Generate unique name
*/
-const char* VISU::Container_i::GenerateName()
+QString VISU::Container_i::GenerateName()
{
return VISU::GenerateName( "Plot2DView", ++myNbPresent );
}
virtual void ToStream( std::ostringstream& theStr );
static const std::string myComment;
virtual const char* GetComment() const;
- virtual const char* GenerateName();
- virtual const char* GetTableTitle();
+ virtual QString GenerateName();
+ virtual QString GetTableTitle();
- virtual char* GetObjectEntry();
+ virtual std::string GetObjectEntry();
};
SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
virtual void ToStream( std::ostringstream& theStr );
static const std::string myComment;
virtual const char* GetComment() const;
- virtual const char* GenerateName();
- virtual const char* GetTableID();
+ virtual QString GenerateName();
+ virtual std::string GetTableID();
virtual CORBA::Boolean IsAuto() { return myAuto; }
virtual CORBA::Boolean IsValid();
virtual void ToStream( std::ostringstream& theStr );
static const std::string myComment;
virtual const char* GetComment() const;
- virtual const char* GenerateName();
+ virtual QString GenerateName();
void Update();
VISU::Curve_i* GetCurve( CORBA::Long theIndex );