}
if (start->IsKind(STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation))) {
-// DeclareAndCast(StepShape_ContextDependentShapeRepresentation,CDSR,start);
-// return Recognize (CDSR->RepresentationRelation());
return Standard_True;
// on fait le pari que, si ce n est pas transferable tel quel,
// des CDSR implicitement references le sont ...
Handle(StepRepr_ProductDefinitionShape) PDS =
Handle(StepRepr_ProductDefinitionShape)::DownCast(subs1.Value());
if(PDS.IsNull()) continue;
- //IsPDS=Standard_True;
Interface_EntityIterator subs2 = graph.Sharings(PDS);
for (subs2.Start(); subs2.More(); subs2.Next()) {
Handle(StepShape_ContextDependentShapeRepresentation) CDSR =
DeclareAndCast(StepShape_ShapeDefinitionRepresentation,SDR,subs3.Value());
Handle(StepRepr_ProductDefinitionShape) PDS1 =
Handle(StepRepr_ProductDefinitionShape)::DownCast(SDR->Definition().PropertyDefinition());
- //Handle(StepRepr_PropertyDefinition) PD = SDR->Definition().PropertyDefinition();
if(PDS1.IsNull()) continue;
Interface_EntityIterator subs4 = graph.Shareds(PDS1);
for (subs4.Start(); subs4.More(); subs4.Next()) {
if ( !myNMTool.IsPureNMShell(aCurrentShell) && !shellClosingsMap.Contains(aCurrentShell) )
brepBuilder.Add(compWithClosings, aCurrentShell);
}
-
-
- comp = compWithClosings;
-
+ comp = compWithClosings;
}
// [END] Try to close OPEN Shells in I-DEAS case (ssv; 17.11.2010)
Handle(TransferBRep_ShapeBinder) shbinder;
//:j2: treat SRRs here in order to compare them with NAUO
Handle(StepRepr_ShapeRepresentationRelationship) SRR = CDSR->RepresentationRelation();
- //DeclareAndCast(StepRepr_RepresentationRelationship,SRR,CDSR->RepresentationRelation());
if ( SRR.IsNull() ) return shbinder;
Standard_Boolean SRRReversed = STEPConstruct_Assembly::CheckSRRReversesNAUO ( TP->Graph(), CDSR );
gp_Trsf Trsf;
Standard_Boolean iatrsf = ComputeSRRWT ( SRR, TP, Trsf );
- /* Delete this part does not work gka
- // use SDR for reading rep in order to handle subassemblies
- Interface_EntityIterator subs = TP->Graph().Sharings(rep);
- Standard_Integer nbitem=0;
- for (subs.Start(); subs.More(); subs.Next()) nbitem++;
- Message_ProgressSentry PS ( TP->GetProgress(), "Shape", 0, nbitem, 1 );
- for (subs.Start(); subs.More() && PS.More() ; subs.Next(),PS.Next()) {
- if ( subs.Value()->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) {
- DeclareAndCast(StepShape_ShapeDefinitionRepresentation,SDR,subs.Value());
-#ifdef TRANSLOG
- if (TP->TraceLevel() > 1)
- sout<<" -- Actor : Ent.n0 "<<TP->Model()->Number(CDSR)<<" -> Sharing Ent.no"<<TP->Model()->Number(SDR)<<endl;
-#endif
-
- binder = TP->Find ( SDR );
- if ( binder.IsNull() ) binder = TransferEntity(SDR,TP);
- theResult = TransferBRep::ShapeResult (binder);
- break;
- }
- }*/
- //if ( theResult.IsNull() && ! subs.More() ) {
Handle(Transfer_Binder) binder;
Standard_Boolean isBound = Standard_False;
if (!TP->IsBound(rep)) binder = TransferEntity(rep,TP,isBound);
else binder = TP->Find(rep);
theResult = TransferBRep::ShapeResult (binder);
- //}
if ( ! theResult.IsNull() ) {
if ( iatrsf ) {
Handle(StepShape_ShapeRepresentation) anitem = Handle(StepShape_ShapeRepresentation)::DownCast(anitemt);
Handle(Transfer_Binder) binder;
Standard_Boolean isBound = Standard_False;
- if (!TP->IsBound(anitem)) binder = TransferEntity(anitem,TP,isBound);//TP->Transferring(anitem);
+ if (!TP->IsBound(anitem)) binder = TransferEntity(anitem,TP,isBound);
else binder = TP->Find(anitem);
TopoDS_Shape theResult = TransferBRep::ShapeResult (binder);
if (!theResult.IsNull()) {
}
-//=======================================================================
-//function : OldWay
-//purpose :
-//=======================================================================
//=======================================================================
//function : IsNeedRepresentation
//purpose :
// La Shape, et la mise en position
Handle(StepShape_ShapeRepresentation) maprep = Handle(StepShape_ShapeRepresentation)::
DownCast(mapit->MappingSource()->MappedRepresentation());
- //Handle(StepRepr_Representation) maprep = mapit->MappingSource()->MappedRepresentation();
Standard_Boolean isBound = Standard_False;
Handle(Transfer_Binder) binder = TP->Find(maprep);
if (binder.IsNull()) binder = TransferEntity(maprep,TP,isBound);
try {
OCC_CATCH_SIGNALS
- StepToTopoDS_Tool myTool;
- StepToTopoDS_DataMapOfTRI aMap;
-
- myTool.Init(aMap, TP);
- StepToTopoDS_TranslateFace myTF;
- myTF.SetPrecision(myPrecision);
- myTF.SetMaxTol(myMaxTol);
-
- // Non-manifold topology is not processed here (ssv; 15.11.2010)
- StepToTopoDS_NMTool dummyNMTool;
- myTF.Init (fs, myTool, dummyNMTool);
- Handle(StepRepr_Representation) oldSRContext = mySRContext;
- if ( mySRContext.IsNull() ) { // if no context, try to find it (ex: r0701_ug.stp #4790)
- Handle(StepRepr_Representation) context = FindContext ( fs, TP );
- if ( context.IsNull() ) {
- TP->AddWarning ( fs, "Entity with no unit context; default units taken" );
- ResetUnits();
+ StepToTopoDS_Tool myTool;
+ StepToTopoDS_DataMapOfTRI aMap;
+
+ myTool.Init(aMap, TP);
+ StepToTopoDS_TranslateFace myTF;
+ myTF.SetPrecision(myPrecision);
+ myTF.SetMaxTol(myMaxTol);
+
+ // Non-manifold topology is not processed here (ssv; 15.11.2010)
+ StepToTopoDS_NMTool dummyNMTool;
+ myTF.Init(fs, myTool, dummyNMTool);
+ Handle(StepRepr_Representation) oldSRContext = mySRContext;
+ if (mySRContext.IsNull()) { // if no context, try to find it (ex: r0701_ug.stp #4790)
+ Handle(StepRepr_Representation) context = FindContext(fs, TP);
+ if (context.IsNull()) {
+ TP->AddWarning(fs, "Entity with no unit context; default units taken");
+ ResetUnits();
+ }
+ else PrepareUnits(context, TP);
}
- else PrepareUnits ( context, TP );
- }
-
- // Apply ShapeFix
- Handle(Transfer_Binder) binder = TP->Find (fs);
- sb = Handle(TransferBRep_ShapeBinder)::DownCast ( binder );
- if ( ! sb.IsNull() && ! sb->Result().IsNull() ) {
- TopoDS_Shape S = sb->Result();
-
- Handle(Standard_Transient) info;
- TopoDS_Shape shape = XSAlgo::AlgoContainer()->ProcessShape( S, myPrecision, myMaxTol,
- "read.step.resource.name",
- "read.step.sequence", info,
- TP->GetProgress() );
- // TopoDS_Shape shape = XSAlgo::AlgoContainer()->PerformFixShape( S, TP, myPrecision, myMaxTol );
- if ( shape != S )
- sb->SetResult ( shape );
-
- XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
- }
-
- if ( oldSRContext.IsNull() && ! mySRContext.IsNull() ) //:S4136
- PrepareUnits ( oldSRContext, TP );
- TP->Bind(fs, sb);
- return sb; // TP->Find (start);
-}
+ // Apply ShapeFix
+ Handle(Transfer_Binder) binder = TP->Find(fs);
+ sb = Handle(TransferBRep_ShapeBinder)::DownCast(binder);
+ if (!sb.IsNull() && !sb->Result().IsNull()) {
+ TopoDS_Shape S = sb->Result();
+
+ Handle(Standard_Transient) info;
+ TopoDS_Shape shape = XSAlgo::AlgoContainer()->ProcessShape(S, myPrecision, myMaxTol,
+ "read.step.resource.name",
+ "read.step.sequence", info,
+ TP->GetProgress());
+ // TopoDS_Shape shape = XSAlgo::AlgoContainer()->PerformFixShape( S, TP, myPrecision, myMaxTol );
+ if (shape != S)
+ sb->SetResult(shape);
+
+ XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
+ }
+
+
+ if (oldSRContext.IsNull() && !mySRContext.IsNull()) //:S4136
+ PrepareUnits(oldSRContext, TP);
+ TP->Bind(fs, sb);
+ return sb; // TP->Find (start);
+ }
catch(Standard_Failure)
{
TP->AddFail(fs,"Exeption is raised. Entity was not translated.");
if (start.IsNull()) return NullResult();
XSAlgo::AlgoContainer()->PrepareForTransfer();
-// myContext.SetModel ( Handle(StepData_StepModel)::DownCast ( TP->Model() ) ); // for asking IsAP203?
-
Handle(Message_Messenger) sout = TP->Messenger();
#ifdef TRANSLOG
// POUR MISE AU POINT, a supprimer ensuite
-// sout<<"STEP->Shape, ent n0 "<<TP->Model()->Number(start)<<" Level="<<TP->NestingLevel()<<endl;
if (TP->TraceLevel() > 1)
sout<<" -- Actor : Transfer Ent.n0 "<<TP->Model()->Number(start)<<" Type "<<start->DynamicType()->Name()<<endl;
#endif
shbinder = OldWay(start,TP);
//skl
- else if(start->IsKind(STANDARD_TYPE(StepBasic_ProductDefinition))) {
- Handle(StepBasic_ProductDefinition) PD =
+ else if (start->IsKind(STANDARD_TYPE(StepBasic_ProductDefinition))) {
+ Handle(StepBasic_ProductDefinition) PD =
Handle(StepBasic_ProductDefinition)::DownCast(start);
- shbinder = TransferEntity(PD,TP);
+ shbinder = TransferEntity(PD, TP);
}
// NextAssemblyUsageOccurrence
else if (start->IsKind(STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence))) {
- Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO =
+ Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO =
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(start);
- shbinder = TransferEntity(NAUO,TP);
+ shbinder = TransferEntity(NAUO, TP);
}
//end skl
mySRContext = rep;
Standard_Integer stat1, stat2 = 0; // sera alimente par STEPControl_Unit
-// DeclareAndCast(StepShape_ShapeRepresentation,sr,start);
if (rep.IsNull()) {
-// TP->AddWarning(sr,"Not a ShapeRepresentation, default unit taken");
ResetUnits();
return;
}
if (theRepCont->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext))) {
DeclareAndCast(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext, theGRCAGAUC,theRepCont);
theGUAC = theGRCAGAUC->GlobalUnitAssignedContext();
-// TP->AddWarning(theRepCont,"No Length Uncertainty, last defined one is taken");
}
// ----------------------------------------------------
}
myMaxTol = Max ( myPrecision, Interface_Static::RVal("read.maxprecision.val") );
// Assign uncertainty
-// Interface_Static::SetRVal("lastpreci",UpdatedValue);
#ifdef TRANSLOG
if (TP->TraceLevel() > 1)
TP->Messenger() <<" Cc1ToTopoDS : Length Unit = "<<myUnit.LengthFactor()<<" Tolerance CASCADE = "<<myPrecision<<endl;
if ( !closingShells.IsEmpty() )
shellClosingsMap.Add(shellA, closingShells);
}
-
}