if in the method XSControl_Reader::SetWS(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch) flag scratch is equal to false then entities from loaded step files were added in the existing STEP model.
{
if (thelibrary.IsNull()) return IFSelect_RetVoid;
if (theprotocol.IsNull()) return IFSelect_RetVoid;
- Handle(Interface_InterfaceModel) model;
+ Handle(Interface_InterfaceModel) model =myModel;
IFSelect_ReturnStatus status = IFSelect_RetVoid;
try {
OCC_CATCH_SIGNALS
{
Standard_Integer effect = 0;
if (transf.IsNull() || !IsLoaded()) return effect;
+
Handle(Interface_InterfaceModel) newmod; // Null au depart
Interface_CheckIterator checks;
checks.SetName("X-STEP WorkSession : RunTransformer");
Standard_Boolean res = transf->Perform
- (thegraph->Graph(),theprotocol,checks,newmod);
+ (thegraph->Graph(),theprotocol,checks,myModel);
if (!checks.IsEmpty(Standard_False)) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
}
Handle(IFSelect_Selection) sel;
- if (np >= 0)
+ if (np >= 0)
{
nomsel[np] = 0;
}
Handle(StepVisual_HArray1OfLayeredItem) aAssignedItems;
StepVisual_LayeredItem aAssignedItemsItem;
Standard_Integer nsub3;
- if (data->ReadSubList (num,3,"assigned_items",ach,nsub3)) {
- Standard_Integer nb3 = data->NbParams(nsub3);
- aAssignedItems = new StepVisual_HArray1OfLayeredItem (1, nb3);
- for (Standard_Integer i3 = 1; i3 <= nb3; i3 ++) {
- //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
- if (data->ReadEntity (nsub3,i3,"assigned_items",ach,aAssignedItemsItem))
- aAssignedItems->SetValue(i3,aAssignedItemsItem);
- }
+ if (data->ReadSubList(num, 3, "assigned_items", ach, nsub3)) {
+ Standard_Integer nb3 = data->NbParams(nsub3);
+ if (nb3)
+ {
+
+ aAssignedItems = new StepVisual_HArray1OfLayeredItem(1, nb3);
+ for (Standard_Integer i3 = 1; i3 <= nb3; i3++) {
+ //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
+ if (data->ReadEntity(nsub3, i3, "assigned_items", ach, aAssignedItemsItem))
+ aAssignedItems->SetValue(i3, aAssignedItemsItem);
+ }
+ }
}
//--- Initialisation of the read entity ---
Standard_Integer num = Number(ent);
if (!num)
return;
+ Standard_Integer nbEnt = NbEntities();
if(theidnums.IsNull())
{
- theidnums = new TColStd_HArray1OfInteger(1, NbEntities());
+ theidnums = new TColStd_HArray1OfInteger(1,nbEnt);
theidnums->Init(0);
}
+ else if(nbEnt > theidnums->Length())
+ {
+ Standard_Integer prevLength = theidnums->Length();
+ Handle(TColStd_HArray1OfInteger) idnums1 = new TColStd_HArray1OfInteger(1,nbEnt);
+ idnums1->Init(0);
+ Standard_Integer k =1;
+ for( ; k <= prevLength; k++)
+ idnums1->SetValue(k , theidnums->Value(k));
+ theidnums = idnums1;
+ }
theidnums->SetValue(num,ident);
}
Handle(String) errmess; // Null si pas d erreur
if (nump > 0 && nump <= NbParams(num)) {
const Interface_FileParameter& FP = Param(num,nump);
- if (FP.ParamType() == Interface_ParamReal) val =
- Interface_FileReaderData::Fastof(FP.CValue());
+ if (FP.ParamType() == Interface_ParamReal || FP.ParamType() == Interface_ParamInteger)
+ val = Interface_FileReaderData::Fastof(FP.CValue());
else errmess = new String("Parameter n0.%d (%s) not a Real");
}
else errmess = new String("Parameter n0.%d (%s) absent");
long status = 1;
DeclareAndCast(StepData_Protocol,stepro,protocol);
if (stepro.IsNull()) return 1;
- Handle(StepData_StepModel) stepmodel = new StepData_StepModel;
- model = stepmodel;
+
+ Handle(StepData_StepModel) stepmodel;
+ if(!model.IsNull())
+ stepmodel = Handle(StepData_StepModel)::DownCast(model);
+ if(stepmodel.IsNull())
+ {
+ stepmodel = new StepData_StepModel;
+ model = stepmodel;
+ }
+
StepFile_ReadTrace (0);
char *pName=(char *)name;
status = StepFile_Read (pName,stepmodel,stepro);
Standard_Integer StepVisual_PresentationLayerAssignment::NbAssignedItems () const
{
- return assignedItems->Length();
+ return (assignedItems.IsNull() ? 0 : assignedItems->Length());
}