mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-06-08 01:57:49 +05:00
To show notebook variables in the Object Browser.
This commit is contained in:
parent
66713229be
commit
1d552bfd2c
@ -231,6 +231,20 @@ module GEOM
|
|||||||
* For example, method return false for GEOM_MARKER
|
* For example, method return false for GEOM_MARKER
|
||||||
*/
|
*/
|
||||||
boolean IsShape();
|
boolean IsShape();
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Set list of parameters
|
||||||
|
* \param theParameters is a string containing the notebook variables separated by ":" symbol,
|
||||||
|
* used for object creation
|
||||||
|
*/
|
||||||
|
void SetParameters (in string theParameters);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Return list of notebook variables used for object creation separated by ":" symbol
|
||||||
|
*/
|
||||||
|
string GetParameters();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,6 +219,14 @@ class GEOM_Object : public MMgt_TShared
|
|||||||
//Returns an auxiliary data
|
//Returns an auxiliary data
|
||||||
Standard_EXPORT TCollection_AsciiString GetAuxData();
|
Standard_EXPORT TCollection_AsciiString GetAuxData();
|
||||||
|
|
||||||
|
//Set a notebook variables used for object creation
|
||||||
|
Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters)
|
||||||
|
{_parameters = theParameters;}
|
||||||
|
|
||||||
|
//Get a notebook variables used for object creation
|
||||||
|
Standard_EXPORT TCollection_AsciiString GetParameters() const
|
||||||
|
{return _parameters;}
|
||||||
|
|
||||||
//###########################################################
|
//###########################################################
|
||||||
// Sub shape methods
|
// Sub shape methods
|
||||||
//###########################################################
|
//###########################################################
|
||||||
@ -270,6 +278,7 @@ class GEOM_Object : public MMgt_TShared
|
|||||||
Handle(TDataStd_TreeNode) _root;
|
Handle(TDataStd_TreeNode) _root;
|
||||||
TDF_Label _label;
|
TDF_Label _label;
|
||||||
TCollection_AsciiString _ior;
|
TCollection_AsciiString _ior;
|
||||||
|
TCollection_AsciiString _parameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -273,6 +273,32 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
|
|||||||
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
|
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
aNameAttrib->SetValue(aShapeName.ToCString());
|
aNameAttrib->SetValue(aShapeName.ToCString());
|
||||||
|
|
||||||
|
//Set NoteBook variables used in the object creation
|
||||||
|
TCollection_AsciiString aParams(aShape->GetParameters());
|
||||||
|
if(!aParams.IsEmpty()) {
|
||||||
|
TCollection_AsciiString aVars;
|
||||||
|
int nbVars = 0;
|
||||||
|
int n = 1;
|
||||||
|
TCollection_AsciiString aParam = aParams.Token(":",1);
|
||||||
|
while( aParam.Length() != 0 ) {
|
||||||
|
aParam = aParams.Token(":",n);
|
||||||
|
if(theStudy->IsVariable(aParam.ToCString())){
|
||||||
|
aVars+=aParam;
|
||||||
|
nbVars++;
|
||||||
|
}
|
||||||
|
if(aParam.Length() == 0)
|
||||||
|
break;
|
||||||
|
aVars+=":";
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
aVars.Remove(aVars.Length(),1);
|
||||||
|
if(nbVars > 0 ) {
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString");
|
||||||
|
SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr);
|
||||||
|
aStringAttrib->SetValue(aVars.ToCString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Set a name of the GEOM object
|
//Set a name of the GEOM object
|
||||||
aShape->SetName(theName);
|
aShape->SetName(theName);
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxDXDYDZ (CORBA::Double the
|
|||||||
Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ);
|
Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
GetObject(anObject)->SetParameters(GetParameters());
|
||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
@ -360,3 +360,14 @@ bool GEOM_Object_i::IsShape()
|
|||||||
{
|
{
|
||||||
return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER;
|
return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GEOM_Object_i::SetParameters(const char* theParameters)
|
||||||
|
{
|
||||||
|
_impl->SetParameters((char*)theParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
char* GEOM_Object_i::GetParameters()
|
||||||
|
{
|
||||||
|
return CORBA::string_dup(_impl->GetParameters().ToCString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -81,11 +81,16 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
|
|||||||
|
|
||||||
virtual bool IsShape();
|
virtual bool IsShape();
|
||||||
|
|
||||||
|
virtual void SetParameters(const char* theParameters);
|
||||||
|
|
||||||
|
virtual char* GetParameters();
|
||||||
|
|
||||||
Handle(GEOM_Object) GetImpl() { return _impl; }
|
Handle(GEOM_Object) GetImpl() { return _impl; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
GEOM::GEOM_Gen_var _engine;
|
GEOM::GEOM_Gen_var _engine;
|
||||||
|
TCollection_AsciiString _parameters;
|
||||||
Handle(GEOM_Object) _impl;
|
Handle(GEOM_Object) _impl;
|
||||||
TopoDS_Shape _geom;
|
TopoDS_Shape _geom;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user