1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

Compare commits

..

2 Commits

Author SHA1 Message Date
ichesnok
1b836c1140 0033487: Data Exchange, Step Import - Unresolved reference crashes
IsNull() check added for Handle(StepVisual_FillAreaStyleColour).
2024-04-17 08:30:58 +01:00
ika
b78ccf1f9b 0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
Add processing of tessellated_annotation_occurrence.
Add test cases.
2024-04-07 10:46:17 +01:00
8 changed files with 125 additions and 20 deletions

View File

@@ -383,16 +383,6 @@ Standard_Boolean RWMesh_CafReader::addShapeIntoDoc (CafDocumentTools& theTools,
return Standard_False;
}
if (toMakeAssembly)
{
TDF_Label aRefLabel;
theTools.ShapeTool->GetReferredShape(aNewLabel, aRefLabel);
if (!aRefLabel.IsNull())
{
theTools.OriginalShapeMap.Bind(theShape, aRefLabel);
}
}
// if new label is a reference get referred shape
TDF_Label aNewRefLabel = aNewLabel;
theTools.ShapeTool->GetReferredShape (aNewLabel, aNewRefLabel);

View File

@@ -57,7 +57,6 @@ public:
Handle(XCAFDoc_ColorTool) ColorTool;
Handle(XCAFDoc_VisMaterialTool) VisMaterialTool;
NCollection_DataMap<TopoDS_Shape, TDF_Label, TopTools_ShapeMapHasher> ComponentMap;
NCollection_DataMap<TopoDS_Shape, TDF_Label, TopTools_ShapeMapHasher> OriginalShapeMap;
};
public:

View File

@@ -2134,11 +2134,12 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
return Standard_False;
}
Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
Handle(StepVisual_AnnotationOccurrence) anAO;
Handle(StepVisual_StyledItem) anAO;
NCollection_Vector<Handle(StepVisual_StyledItem)> anAnnotations;
if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)))
if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)) ||
thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence)))
{
anAO = Handle(StepVisual_AnnotationOccurrence)::DownCast(thePresentEntity);
anAO = Handle(StepVisual_StyledItem)::DownCast(thePresentEntity);
if (!anAO.IsNull())
{
thePresentName = anAO->Name();
@@ -4368,7 +4369,8 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
}
}
else if (anEnt->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout)) ||
anEnt->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)))
anEnt->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)) ||
anEnt->IsKind(STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence)))
{
// Protection against import presentation twice
Handle(StepVisual_DraughtingCallout) aDC;

View File

@@ -634,7 +634,7 @@ Standard_Boolean STEPConstruct_Styles::GetColors (const Handle(StepVisual_Styled
for ( Standard_Integer m=1; m <= FAS->NbFillStyles(); m++ ) {
StepVisual_FillStyleSelect FSS = FAS->FillStylesValue ( m );
Handle(StepVisual_FillAreaStyleColour) FASC = FSS.FillAreaStyleColour();
if ( SurfCol.IsNull() || SSU->Side() != StepVisual_ssNegative ) //abv 30 Mar 00: trj3_s1-pe.stp
if ( !FASC.IsNull() && (SurfCol.IsNull() || SSU->Side() != StepVisual_ssNegative) ) //abv 30 Mar 00: trj3_s1-pe.stp
SurfCol = FASC->FillColour();
}
continue;

View File

@@ -3,12 +3,12 @@ set filename bug29362_MMT200.stp
set ref_data {
NbOfDimensions : 2
NbOfDimensions : 4
NbOfDimensionalSize : 1
NbOfDimensionalLocation: 1
NbOfAngular : 0
NbOfWithPath : 0
NbOfCommonLabels : 0
NbOfCommonLabels : 1
NbOfTolerances : 0
NbOfGTWithModifiers : 0
NbOfGTWithMaxTolerance : 0

92
tests/gdt/import/A6 Normal file
View File

@@ -0,0 +1,92 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename bug33661_nist_ftc_08_asme1_ap242-e1-tg.stp
set ref_data {
NbOfDimensions : 60
NbOfTolerances : 0
NbOfDatumFeature : 0
NbOfAttachedDatum : 0
NbOfDatumTarget : 0
0:1:1:2:1 Shape.4
0:1:4:32 Dimension.4.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:2 Shape.5
0:1:4:4 Dimension.5.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:5 Dimension.5.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:4 Shape.7
0:1:4:14 Dimension.7.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:18 Dimension.7.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:20 Dimension.7.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:14 Shape.17
0:1:4:27 Dimension.17.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:62 Shape.65
0:1:4:35 Dimension.65.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:65 Shape.68
0:1:4:36 Dimension.68.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:72 Shape.75
0:1:4:53 Dimension.75.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:84 Shape.87
0:1:4:54 Dimension.87.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:90 Shape.93
0:1:4:31 Dimension.93.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:33 Dimension.93.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:34 Dimension.93.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:94 Shape.97
0:1:4:39 Dimension.97.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:40 Dimension.97.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:51 Dimension.97.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:52 Dimension.97.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:55 Dimension.97.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:96 Shape.99
0:1:4:43 Dimension.99.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:44 Dimension.99.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:45 Dimension.99.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:46 Dimension.99.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:57 Dimension.99.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:98 Shape.101
0:1:4:47 Dimension.101.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:48 Dimension.101.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:49 Dimension.101.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:50 Dimension.101.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:56 Dimension.101.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:100 Shape.103
0:1:4:37 Dimension.103.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:38 Dimension.103.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:41 Dimension.103.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:42 Dimension.103.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:58 Dimension.103.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:102 Shape.105
0:1:4:25 Dimension.105.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:26 Dimension.105.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:116 Shape.119
0:1:4:24 Dimension.119.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:120 Shape.123
0:1:4:23 Dimension.123.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:161 Shape.164
0:1:4:15 Dimension.164.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:179 Shape.182
0:1:4:1 Dimension.182.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:2 Dimension.182.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:3 Dimension.182.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:237 Shape.240
0:1:4:17 Dimension.240.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:19 Dimension.240.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:246 Shape.249
0:1:4:6 Dimension.249.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:8 Dimension.249.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:9 Dimension.249.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:248 Shape.251
0:1:4:7 Dimension.251.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:10 Dimension.251.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:11 Dimension.251.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:250 Shape.253
0:1:4:12 Dimension.253.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:13 Dimension.253.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:2:256 Shape.259
0:1:4:28 Dimension.259.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:29 Dimension.259.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:4:30 Dimension.259.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
0:1:1:3:1 Shape.276
0:1:4:16 Dimension.276.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
}

View File

@@ -2,7 +2,13 @@
set filename bug29362_MMT200.stp
set ref_data {
Centre of mass: 0 0 0
Mass: 0
Centre of mass: 13.412719368151439 6.1818909424750705 -13.415402720911091
Mass: 252.25931515680639
}
set ref_data_write {
Centre of mass: 13.412719368151233 6.1818909424748316 -13.415402720907935
Mass: 252.25931515678892
}

16
tests/gdt/presentation/C3 Normal file
View File

@@ -0,0 +1,16 @@
# !!!! This file is generated automatically, do not edit manually! See end script
puts "TODO CR11111 ALL: Error on writing file"
set filename bug33661_nist_ftc_08_asme1_ap242-e1-tg.stp
set ref_data {
Centre of mass: -62.99891835601813 78.203476181663817 20.269103705327481
Mass: 47784.542040997127
}
set ref_data_write {
Centre of mass: -261.12759307366923 196.9986700086933 -13.86055926862322
Mass: 17568.06377585962
}