* For example, method return false for GEOM_MARKER
*/
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();
+
};
//Returns an auxiliary data
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
//###########################################################
Handle(TDataStd_TreeNode) _root;
TDF_Label _label;
TCollection_AsciiString _ior;
+ TCollection_AsciiString _parameters;
};
#endif
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
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
aShape->SetName(theName);
Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
-
+ GetObject(anObject)->SetParameters(GetParameters());
+
return GetObject(anObject);
}
{
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());
+}
+
virtual bool IsShape();
+ virtual void SetParameters(const char* theParameters);
+
+ virtual char* GetParameters();
+
Handle(GEOM_Object) GetImpl() { return _impl; }
private:
GEOM::GEOM_Gen_var _engine;
+ TCollection_AsciiString _parameters;
Handle(GEOM_Object) _impl;
TopoDS_Shape _geom;
};