From 11653f0ddd03014eca791cbe808fefe8f3a0906f Mon Sep 17 00:00:00 2001 From: gka Date: Wed, 13 Jan 2016 19:08:55 +0300 Subject: [PATCH] Modification to translation graphic PMI defined by tessellation --- src/RWStepAP214/RWStepAP214_GeneralModule.cxx | 92 ++++++++++- .../RWStepAP214_ReadWriteModule.cxx | 103 +++++++++++++ src/RWStepVisual/FILES | 12 ++ .../RWStepVisual_RWCoordinatesList.cxx | 125 +++++++++++++++ .../RWStepVisual_RWCoordinatesList.hxx | 49 ++++++ ...sual_RWTessellatedAnnotationOccurrence.cxx | 92 +++++++++++ ...sual_RWTessellatedAnnotationOccurrence.hxx | 45 ++++++ .../RWStepVisual_RWTessellatedCurveSet.cxx | 116 ++++++++++++++ .../RWStepVisual_RWTessellatedCurveSet.hxx | 49 ++++++ ...RWStepVisual_RWTessellatedGeometricSet.cxx | 104 +++++++++++++ ...RWStepVisual_RWTessellatedGeometricSet.hxx | 48 ++++++ .../RWStepVisual_RWTessellatedItem.cxx | 60 ++++++++ .../RWStepVisual_RWTessellatedItem.hxx | 48 ++++++ src/STEPCAFControl/STEPCAFControl_Reader.cxx | 143 +++++++++++++++++- src/StepAP214/StepAP214_Protocol.cxx | 15 ++ src/StepVisual/FILES | 10 ++ .../StepVisual_AnnotationOccurrence.cxx | 2 + .../StepVisual_AnnotationOccurrence.hxx | 1 - src/StepVisual/StepVisual_CoordinatesList.cxx | 31 ++++ src/StepVisual/StepVisual_CoordinatesList.hxx | 45 ++++++ .../StepVisual_DraughtingCalloutElement.cxx | 9 ++ .../StepVisual_DraughtingCalloutElement.hxx | 4 + ...Visual_TessellatedAnnotationOccurrence.cxx | 21 +++ ...Visual_TessellatedAnnotationOccurrence.hxx | 36 +++++ .../StepVisual_TessellatedCurveSet.cxx | 42 +++++ .../StepVisual_TessellatedCurveSet.hxx | 60 ++++++++ .../StepVisual_TessellatedGeometricSet.cxx | 33 ++++ .../StepVisual_TessellatedGeometricSet.hxx | 54 +++++++ src/StepVisual/StepVisual_TessellatedItem.cxx | 20 +++ src/StepVisual/StepVisual_TessellatedItem.hxx | 37 +++++ .../XCAFDimTolObjects_DimensionObject.hxx | 2 +- src/XCAFDoc/XCAFDoc_Dimension.cxx | 12 +- 32 files changed, 1504 insertions(+), 16 deletions(-) create mode 100644 src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWCoordinatesList.hxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.hxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.hxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.hxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedItem.cxx create mode 100644 src/RWStepVisual/RWStepVisual_RWTessellatedItem.hxx create mode 100644 src/StepVisual/StepVisual_CoordinatesList.cxx create mode 100644 src/StepVisual/StepVisual_CoordinatesList.hxx create mode 100644 src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.cxx create mode 100644 src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.hxx create mode 100644 src/StepVisual/StepVisual_TessellatedCurveSet.cxx create mode 100644 src/StepVisual/StepVisual_TessellatedCurveSet.hxx create mode 100644 src/StepVisual/StepVisual_TessellatedGeometricSet.cxx create mode 100644 src/StepVisual/StepVisual_TessellatedGeometricSet.hxx create mode 100644 src/StepVisual/StepVisual_TessellatedItem.cxx create mode 100644 src/StepVisual/StepVisual_TessellatedItem.hxx diff --git a/src/RWStepAP214/RWStepAP214_GeneralModule.cxx b/src/RWStepAP214/RWStepAP214_GeneralModule.cxx index b48148446d..fc10e64e7a 100644 --- a/src/RWStepAP214/RWStepAP214_GeneralModule.cxx +++ b/src/RWStepAP214/RWStepAP214_GeneralModule.cxx @@ -1093,6 +1093,19 @@ #include #include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule) //#define DeclareAndCast(atype,result,start) \ NON car Name @@ -1327,6 +1340,19 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule) #include #include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + static Standard_Integer catsh,catdr,catstr,catdsc,cataux; @@ -5037,6 +5063,44 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN, } break; + case 707: + { + DeclareAndCast(StepVisual_TessellatedAnnotationOccurrence,anent,ent); + RWStepVisual_RWTessellatedAnnotationOccurrence tool; + tool.Share(anent,iter); + } + break; + + case 708: + { + DeclareAndCast(StepVisual_TessellatedItem,anent,ent); + RWStepVisual_RWTessellatedItem tool; + tool.Share(anent,iter); + } + break; + + case 709: + { + DeclareAndCast(StepVisual_TessellatedGeometricSet,anent,ent); + RWStepVisual_RWTessellatedGeometricSet tool; + tool.Share(anent,iter); + } + break; + case 710: + { + DeclareAndCast(StepVisual_TessellatedCurveSet,anent,ent); + RWStepVisual_RWTessellatedCurveSet tool; + tool.Share(anent,iter); + } + break; + + case 711: + { + DeclareAndCast(StepVisual_CoordinatesList,anent,ent); + RWStepVisual_RWCoordinatesList tool; + tool.Share(anent,iter); + } + break; default : break; } } @@ -7005,6 +7069,26 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid ent = new StepDimTol_GeoTolAndGeoTolWthMaxTol; break; + case 707: + ent = new StepVisual_TessellatedAnnotationOccurrence; + break; + + case 708: + ent = new StepVisual_TessellatedItem; + break; + + case 709: + ent = new StepVisual_TessellatedGeometricSet; + break; + + case 710: + ent = new StepVisual_TessellatedCurveSet; + break; + + case 711: + ent = new StepVisual_CoordinatesList; + break; + default: return Standard_False; } @@ -7589,7 +7673,13 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber case 703: case 704: return catdr; case 705: - case 706: return cataux; + case 706: + case 707: + case 708: + case 709: + case 710: + case 711: + return cataux; default : break; } diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx index bc9279ea12..718eb4a9a6 100644 --- a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx +++ b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx @@ -1376,6 +1376,17 @@ Handle(atype) result = Handle(atype)::DownCast (start) #include #include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include // -- General Declarations (Recognize, StepType) --- @@ -2007,6 +2018,10 @@ static TCollection_AsciiString Reco_FeatureForDatumTargetRelationship("FEATURE_F static TCollection_AsciiString Reco_DraughtingModelItemAssociation("DRAUGHTING_MODEL_ITEM_ASSOCIATION"); static TCollection_AsciiString Reco_AnnotationPlane("ANNOTATION_PLANE"); +static TCollection_AsciiString Reco_TessellatedAnnotationOccurrence("TESSELLATED_ANNOTATION_OCCURRENCE"); +static TCollection_AsciiString Reco_TessellatedGeometricSet("TESSELLATED_GEOMETRIC_SET"); +static TCollection_AsciiString Reco_TessellatedCurveSet("TESSELLATED_CURVE_SET"); +static TCollection_AsciiString Reco_CoordinatesList("COORDINATES_LIST"); // -- Definition of the libraries -- static Handle(Dico_DictionaryOfInteger) typenums; @@ -2653,6 +2668,13 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule () typenums->SetItem (Reco_DraughtingModelItemAssociation, 703); typenums->SetItem (Reco_AnnotationPlane, 704); + typenums->SetItem (Reco_TessellatedAnnotationOccurrence,707); + typenums->SetItem (Reco_TessellatedGeometricSet, 709); + + typenums->SetItem ( Reco_TessellatedCurveSet, 710); + typenums->SetItem ( Reco_CoordinatesList, 711); + + // SHORT NAMES // NB : la liste est celle de AP203 // Directement exploite pour les types simples @@ -4465,6 +4487,12 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType case 703: return Reco_DraughtingModelItemAssociation; case 704: return Reco_AnnotationPlane; + case 707 : return Reco_TessellatedAnnotationOccurrence; + case 709 : return Reco_TessellatedGeometricSet; + + case 710 : return Reco_TessellatedCurveSet; + case 711 : return Reco_CoordinatesList; + default : return PasReco; } } @@ -9244,6 +9272,43 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN, tool.ReadStep (data,num,ach,anent); } break; + case 707: + { + DeclareAndCast(StepVisual_TessellatedAnnotationOccurrence,anent,ent); + RWStepVisual_RWTessellatedAnnotationOccurrence tool; + tool.ReadStep (data,num,ach,anent); + } + break; + + case 708: + { + DeclareAndCast(StepVisual_TessellatedItem,anent,ent); + RWStepVisual_RWTessellatedItem tool; + tool.ReadStep (data,num,ach,anent); + } + break; + + case 709: + { + DeclareAndCast(StepVisual_TessellatedGeometricSet,anent,ent); + RWStepVisual_RWTessellatedGeometricSet tool; + tool.ReadStep (data,num,ach,anent); + } + break; + case 710: + { + DeclareAndCast(StepVisual_TessellatedCurveSet,anent,ent); + RWStepVisual_RWTessellatedCurveSet tool; + tool.ReadStep (data,num,ach,anent); + } + break; + case 711: + { + DeclareAndCast(StepVisual_CoordinatesList,anent,ent); + RWStepVisual_RWCoordinatesList tool; + tool.ReadStep (data,num,ach,anent); + } + break; default: ach->AddFail("Type Mismatch when reading - Entity"); @@ -13993,6 +14058,44 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN, tool.WriteStep (SW,anent); } break; + case 707: + { + DeclareAndCast(StepVisual_TessellatedAnnotationOccurrence,anent,ent); + RWStepVisual_RWTessellatedAnnotationOccurrence tool; + tool.WriteStep (SW,anent); + } + break; + + case 708: + { + DeclareAndCast(StepVisual_TessellatedItem,anent,ent); + RWStepVisual_RWTessellatedItem tool; + tool.WriteStep (SW,anent); + } + break; + + case 709: + { + DeclareAndCast(StepVisual_TessellatedGeometricSet,anent,ent); + RWStepVisual_RWTessellatedGeometricSet tool; + tool.WriteStep (SW,anent); + } + break; + case 710: + { + DeclareAndCast(StepVisual_TessellatedCurveSet,anent,ent); + RWStepVisual_RWTessellatedCurveSet tool; + tool.WriteStep (SW,anent); + } + break; + case 711: + { + DeclareAndCast(StepVisual_CoordinatesList,anent,ent); + RWStepVisual_RWCoordinatesList tool; + tool.WriteStep(SW,anent); + + } + break; default: return; diff --git a/src/RWStepVisual/FILES b/src/RWStepVisual/FILES index 87883fea73..7208bb7023 100644 --- a/src/RWStepVisual/FILES +++ b/src/RWStepVisual/FILES @@ -124,3 +124,15 @@ RWStepVisual_RWTextStyleWithBoxCharacteristics.cxx RWStepVisual_RWTextStyleWithBoxCharacteristics.hxx RWStepVisual_RWViewVolume.cxx RWStepVisual_RWViewVolume.hxx +RWStepVisual_RWTessellatedItem.hxx +RWStepVisual_RWTessellatedItem.cxx +RWStepVisual_RWTessellatedAnnotationOccurrence.hxx +RWStepVisual_RWTessellatedAnnotationOccurrence.cxx +RWStepVisual_RWTessellatedGeometricSet.hxx +RWStepVisual_RWTessellatedGeometricSet.cxx +RWStepVisual_RWCoordinatesList.hxx +RWStepVisual_RWCoordinatesList.cxx +RWStepVisual_RWTessellatedCurveSet.hxx +RWStepVisual_RWTessellatedCurveSet.cxx + + diff --git a/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx b/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx new file mode 100644 index 0000000000..b239357d21 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx @@ -0,0 +1,125 @@ +// Created on: 2015-10-29 +// Created by: Irina KRYLOVA +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//function : RWStepVisual_RWCoordinatesList +//purpose : +//======================================================================= +RWStepVisual_RWCoordinatesList::RWStepVisual_RWCoordinatesList () {} + +//======================================================================= +//function : ReadStep +//purpose : +//======================================================================= +void RWStepVisual_RWCoordinatesList::ReadStep + (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_CoordinatesList)& ent) const +{ + // Number of Parameter Control + if (!data->CheckNbParams(num, 3, ach, "coordinate list")) return; + + // Inherited field : name + Handle(TCollection_HAsciiString) aName; + data->ReadString (num, 1, "name", ach, aName); + Standard_Integer nbP =0; + data->ReadInteger(num, 2, "number_points", ach,nbP); + + Handle(TColgp_HArray1OfXYZ) aPoints;// = new TColgp_HArray1OfXYZ(1, nbP); + Standard_Integer nsub2; + if (data->ReadSubList (num,3,"items",ach,nsub2)) + { + Standard_Integer nb2 = data->NbParams(nsub2); + if( !nb2) + return; + aPoints = new TColgp_HArray1OfXYZ(1, nb2); + for (Standard_Integer i = 1; i <= nb2; i++) + { + gp_XYZ aXYZ(0.,0.,0.); + Standard_Integer nsub3; + if (data->ReadSubList (nsub2,i,"coordinates",ach,nsub3)) { + Standard_Integer nb2 = data->NbParams(nsub3); + if(nb2 > 3) { + ach->AddWarning("More than 3 coordinates, ignored"); + } + Standard_Integer nbcoord = Min (nb2, 3); + for (Standard_Integer j = 1; j <= nbcoord; j++) { + Standard_Real aVal =0.; + if (data->ReadReal (nsub3,j,"coordinates",ach,aVal)) { + aXYZ.SetCoord(j, aVal); + } + } + + } + aPoints->SetValue(i, aXYZ); + } + } + + + //--- Initialisation of the read entity --- + + + ent->Init(aName, aPoints); +} + +//======================================================================= +//function : WriteStep +//purpose : +//======================================================================= +void RWStepVisual_RWCoordinatesList::WriteStep + (StepData_StepWriter& SW, const Handle(StepVisual_CoordinatesList)& ent) const +{ + // Inherited field : name + //SW.Send(ent->Name()); + + //// Inherited field : styles + + //SW.OpenSub(); + //for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) { + // SW.Send(ent->StylesValue(i2)); + //} + //SW.CloseSub(); + + //// Inherited field : item + + //SW.Send(ent->Item()); +} + +//======================================================================= +//function : Share +//purpose : +//======================================================================= +void RWStepVisual_RWCoordinatesList::Share(const Handle(StepVisual_CoordinatesList)& ent, Interface_EntityIterator& iter) const +{ + /*Standard_Integer nbElem1 = ent->NbStyles(); + for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) { + iter.GetOneItem(ent->StylesValue(is1)); + } + iter.GetOneItem(ent->Item());*/ +} diff --git a/src/RWStepVisual/RWStepVisual_RWCoordinatesList.hxx b/src/RWStepVisual/RWStepVisual_RWCoordinatesList.hxx new file mode 100644 index 0000000000..0bcf495927 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWCoordinatesList.hxx @@ -0,0 +1,49 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _RWStepVisual_RWCoordinatesList_HeaderFile +#define _RWStepVisual_RWCoordinatesList_HeaderFile + +#include +#include +#include + +#include +#include +class Interface_Check; +class StepVisual_CoordinatesList; +class StepData_StepWriter; +class Interface_EntityIterator; + +//! Read & Write Module for AnnotationOccurrence +class RWStepVisual_RWCoordinatesList +{ +public: + + DEFINE_STANDARD_ALLOC + + Standard_EXPORT RWStepVisual_RWCoordinatesList(); + + Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_CoordinatesList)& ent) const; + + Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_CoordinatesList)& ent) const; + + Standard_EXPORT void Share (const Handle(StepVisual_CoordinatesList)& ent, Interface_EntityIterator& iter) const; + +}; +#endif // _RWStepVisual_RWCoordinatesList_HeaderFile diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx new file mode 100644 index 0000000000..110b635ba7 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx @@ -0,0 +1,92 @@ +// Created on: 2015-10-29 +// Created by: Irina KRYLOVA +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +RWStepVisual_RWTessellatedAnnotationOccurrence::RWStepVisual_RWTessellatedAnnotationOccurrence () {} + +void RWStepVisual_RWTessellatedAnnotationOccurrence::ReadStep + (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedAnnotationOccurrence)& ent) const +{ + + // Number of Parameter Control + if (!data->CheckNbParams(num, 3, ach, "styled_item")) return; + + // Inherited field : name + Handle(TCollection_HAsciiString) aName; + data->ReadString (num, 1, "name", ach, aName); + + // Inherited field : styles + Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; + Handle(StepVisual_PresentationStyleAssignment) anent2; + Standard_Integer nsub2; + if (data->ReadSubList (num,2,"styles",ach,nsub2)) { + Standard_Integer nb2 = data->NbParams(nsub2); + aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); + for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) { + if (data->ReadEntity (nsub2, i2,"presentation_style_assignment", ach, + STANDARD_TYPE(StepVisual_PresentationStyleAssignment), anent2)) + aStyles->SetValue(i2, anent2); + } + } + + // Inherited field : item + Handle(StepRepr_RepresentationItem) aItem; + data->ReadEntity(num, 3,"item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), aItem); + + // Initialisation of the read entity + ent->Init(aName, aStyles, aItem); +} + +void RWStepVisual_RWTessellatedAnnotationOccurrence::WriteStep + (StepData_StepWriter& SW, + const Handle(StepVisual_TessellatedAnnotationOccurrence)& ent) const +{ + //Inherited field : name + SW.Send(ent->Name()); + + // Inherited field : styles + SW.OpenSub(); + for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) { + SW.Send(ent->StylesValue(i2)); + } + SW.CloseSub(); + + // Inherited field : item + + SW.Send(ent->Item()); +} + +void RWStepVisual_RWTessellatedAnnotationOccurrence::Share(const Handle(StepVisual_TessellatedAnnotationOccurrence)& ent, Interface_EntityIterator& iter) const +{ + + Standard_Integer nbElem1 = ent->NbStyles(); + for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) { + iter.GetOneItem(ent->StylesValue(is1)); + } + + iter.GetOneItem(ent->Item()); +} diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.hxx b/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.hxx new file mode 100644 index 0000000000..99006f6b32 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.hxx @@ -0,0 +1,45 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _RWStepVisual_RWTessellatedAnnotationOccurrence_HeaderFile +#define _RWStepVisual_RWTessellatedAnnotationOccurrence_HeaderFile + +#include +#include +#include + +#include +class StepData_StepReaderData; +class Interface_Check; +class StepVisual_TessellatedAnnotationOccurrence; +class StepData_StepWriter; +class Interface_EntityIterator; + +//! Read & Write Module for AnnotationOccurrence +class RWStepVisual_RWTessellatedAnnotationOccurrence +{ +public: + + DEFINE_STANDARD_ALLOC + + Standard_EXPORT RWStepVisual_RWTessellatedAnnotationOccurrence(); + + Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepVisual_TessellatedAnnotationOccurrence)& ent) const; + + Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_TessellatedAnnotationOccurrence)& ent) const; + + Standard_EXPORT void Share (const Handle(StepVisual_TessellatedAnnotationOccurrence)& ent, Interface_EntityIterator& iter) const; +}; +#endif // _RWStepVisual_RWTessellatedAnnotationOccurrence_HeaderFile diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx new file mode 100644 index 0000000000..5405d3a448 --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx @@ -0,0 +1,116 @@ +// Created on: 2015-10-29 +// Created by: Irina KRYLOVA +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//function : RWStepVisual_RWTessellatedCurveSet +//purpose : +//======================================================================= +RWStepVisual_RWTessellatedCurveSet::RWStepVisual_RWTessellatedCurveSet () {} + +//======================================================================= +//function : ReadStep +//purpose : +//======================================================================= +void RWStepVisual_RWTessellatedCurveSet::ReadStep + (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedCurveSet)& ent) const +{ + // Number of Parameter Control + if (!data->CheckNbParams(num, 3, ach, "tessellated_curve_set")) return; + + // Inherited field : name + Handle(TCollection_HAsciiString) aName; + data->ReadString (num, 1, "name", ach, aName); + + Handle(StepVisual_CoordinatesList) aCoordList; + data->ReadEntity (num, 2,"coord_list",ach,STANDARD_TYPE(StepVisual_CoordinatesList), aCoordList); + //--- Initialisation of the read entity --- + Standard_Integer nsub2; + NCollection_Handle aCurves = new StepVisual_VectorOfHSequenceOfInteger; + if (data->ReadSubList (num,3,"curves",ach,nsub2)) + { + Standard_Integer nb2 = data->NbParams(nsub2); + if( !nb2) + return; + + for (Standard_Integer i = 1; i <= nb2; i++) + { + Handle(TColStd_HSequenceOfInteger) aCurve = new TColStd_HSequenceOfInteger; + Standard_Integer nsub3; + if (data->ReadSubList (nsub2,i,"number_coordinates",ach,nsub3)) { + Standard_Integer nb2 = data->NbParams(nsub3); + for (Standard_Integer j = 1; j <= nb2; j++) { + Standard_Integer aVal =0; + if (data->ReadInteger (nsub3,j,"coordinates",ach,aVal)) + aCurve->Append(aVal); + + } + aCurves->Append(aCurve); + + } + } + } + ent->Init(aName, aCoordList, aCurves); + +} + + //======================================================================= + //function : WriteStep + //purpose : + //======================================================================= + void RWStepVisual_RWTessellatedCurveSet::WriteStep + (StepData_StepWriter& SW, + const Handle(StepVisual_TessellatedCurveSet)& ent) const + { + // Inherited field : name + //SW.Send(ent->Name()); + + //// Inherited field : styles + + //SW.OpenSub(); + //for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) { + // SW.Send(ent->StylesValue(i2)); + //} + //SW.CloseSub(); + + //// Inherited field : item + + //SW.Send(ent->Item()); + } + + //======================================================================= + //function : Share + //purpose : + //======================================================================= + void RWStepVisual_RWTessellatedCurveSet::Share(const Handle(StepVisual_TessellatedCurveSet)& ent, Interface_EntityIterator& iter) const + { + /*Standard_Integer nbElem1 = ent->NbStyles(); + for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) { + iter.GetOneItem(ent->StylesValue(is1)); + } + iter.GetOneItem(ent->Item());*/ + } diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.hxx b/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.hxx new file mode 100644 index 0000000000..3075660ecb --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.hxx @@ -0,0 +1,49 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _RWStepVisual_RWTessellatedCurveSet_HeaderFile +#define _RWStepVisual_RWTessellatedCurveSet_HeaderFile + +#include +#include +#include + +#include +#include +class StepData_StepReaderData; +class Interface_Check; +//class StepVisual_TessellatedCurveSet; +class StepData_StepWriter; +class Interface_EntityIterator; + +//! Read & Write Module for AnnotationOccurrence +class RWStepVisual_RWTessellatedCurveSet +{ +public: + + DEFINE_STANDARD_ALLOC + + Standard_EXPORT RWStepVisual_RWTessellatedCurveSet(); + + Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedCurveSet)& ent) const; + + Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_TessellatedCurveSet)& ent) const; + + Standard_EXPORT void Share (const Handle(StepVisual_TessellatedCurveSet)& ent, Interface_EntityIterator& iter) const; +}; +#endif // _RWStepVisual_RWTessellatedItem_HeaderFile diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx new file mode 100644 index 0000000000..0463a5e65d --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx @@ -0,0 +1,104 @@ +// Created on: 2015-10-29 +// Created by: Irina KRYLOVA +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//function : RWStepVisual_RWTessellatedGeometricSet +//purpose : +//======================================================================= +RWStepVisual_RWTessellatedGeometricSet::RWStepVisual_RWTessellatedGeometricSet () {} + +//======================================================================= +//function : ReadStep +//purpose : +//======================================================================= +void RWStepVisual_RWTessellatedGeometricSet::ReadStep + (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedGeometricSet)& ent) const +{ + // Number of Parameter Control + if (!data->CheckNbParams(num, 2, ach, "tessellated_geometric_set")) return; + + // Inherited field : name + Handle(TCollection_HAsciiString) aName; + data->ReadString (num, 1, "name", ach, aName); + + NCollection_Handle anItems; + Standard_Integer nsub2; + if (data->ReadSubList (num,2,"items",ach,nsub2)) { + Standard_Integer nb2 = data->NbParams(nsub2); + anItems = new StepVisual_Array1OfTessellaltedItem(1, nb2); + for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) { + Handle(StepVisual_TessellatedItem) anItem;// = new StepVisual_TesselatedItem; + if (data->ReadEntity (nsub2,i2,"item",ach,STANDARD_TYPE(StepVisual_TessellatedItem), anItem)) + anItems->SetValue(i2,anItem); + } + } + + //--- Initialisation of the read entity --- + + + ent->Init(aName, anItems); +} + +//======================================================================= +//function : WriteStep +//purpose : +//======================================================================= +void RWStepVisual_RWTessellatedGeometricSet::WriteStep + (StepData_StepWriter& SW, + const Handle(StepVisual_TessellatedGeometricSet)& ent) const +{ + // Inherited field : name + //SW.Send(ent->Name()); + + //// Inherited field : styles + + //SW.OpenSub(); + //for (Standard_Integer i2 = 1; i2 <= ent->NbStyles(); i2 ++) { + // SW.Send(ent->StylesValue(i2)); + //} + //SW.CloseSub(); + + //// Inherited field : item + + //SW.Send(ent->Item()); +} + +//======================================================================= +//function : Share +//purpose : +//======================================================================= +void RWStepVisual_RWTessellatedGeometricSet::Share(const Handle(StepVisual_TessellatedGeometricSet)& ent, Interface_EntityIterator& iter) const +{ + /*Standard_Integer nbElem1 = ent->NbStyles(); + for (Standard_Integer is1=1; is1<=nbElem1; is1 ++) { + iter.GetOneItem(ent->StylesValue(is1)); + } + iter.GetOneItem(ent->Item());*/ +} diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.hxx b/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.hxx new file mode 100644 index 0000000000..22b04348be --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.hxx @@ -0,0 +1,48 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _RWStepVisual_RWTessellatedGeometricSet_HeaderFile +#define _RWStepVisual_RWTessellatedGeometricSet_HeaderFile + +#include +#include +#include + +#include +class StepData_StepReaderData; +class Interface_Check; +class StepVisual_TessellatedGeometricSet; +class StepData_StepWriter; +class Interface_EntityIterator; + +//! Read & Write Module for AnnotationOccurrence +class RWStepVisual_RWTessellatedGeometricSet +{ +public: + + DEFINE_STANDARD_ALLOC + + Standard_EXPORT RWStepVisual_RWTessellatedGeometricSet(); + + Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedGeometricSet)& ent) const; + + Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_TessellatedGeometricSet)& ent) const; + + Standard_EXPORT void Share (const Handle(StepVisual_TessellatedGeometricSet)& ent, Interface_EntityIterator& iter) const; +}; +#endif // _RWStepVisual_RWTessellatedItem_HeaderFile diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedItem.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedItem.cxx new file mode 100644 index 0000000000..3b4e255f3c --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedItem.cxx @@ -0,0 +1,60 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include +#include +#include +#include + +RWStepVisual_RWTessellatedItem::RWStepVisual_RWTessellatedItem () {} + +void RWStepVisual_RWTessellatedItem::ReadStep + (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedItem)& ent) const +{ + + + // --- Number of Parameter Control --- + + if (!data->CheckNbParams(num,1,ach,"tessellated_item")) return; + + // --- inherited field : name --- + + Handle(TCollection_HAsciiString) aName; + //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed + data->ReadString (num,1,"name",ach,aName); + + //--- Initialisation of the read entity --- + + + ent->Init(aName); +} + + +void RWStepVisual_RWTessellatedItem::WriteStep + (StepData_StepWriter& SW, + const Handle(StepVisual_TessellatedItem)& ent) const +{ + + // --- inherited field name --- + + SW.Send(ent->Name()); +} + +void RWStepVisual_RWTessellatedItem::Share (const Handle(StepVisual_TessellatedItem)& ent, Interface_EntityIterator& iter) const +{ +} \ No newline at end of file diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedItem.hxx b/src/RWStepVisual/RWStepVisual_RWTessellatedItem.hxx new file mode 100644 index 0000000000..99857d1dbf --- /dev/null +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedItem.hxx @@ -0,0 +1,48 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _RWStepVisual_RWTessellatedItem_HeaderFile +#define _RWStepVisual_RWTessellatedItem_HeaderFile + +#include +#include +#include + +#include +class StepData_StepReaderData; +class Interface_Check; +class StepVisual_TessellatedItem; +class StepData_StepWriter; +class Interface_EntityIterator; + +//! Read & Write Module for AnnotationOccurrence +class RWStepVisual_RWTessellatedItem +{ +public: + + DEFINE_STANDARD_ALLOC + + Standard_EXPORT RWStepVisual_RWTessellatedItem(); + + Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepVisual_TessellatedItem)& ent) const; + + Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_TessellatedItem)& ent) const; + + Standard_EXPORT void Share (const Handle(StepVisual_TessellatedItem)& ent, Interface_EntityIterator& iter) const; +}; +#endif // _RWStepVisual_RWTessellatedItem_HeaderFile diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index 686998deee..3e3f832478 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -232,6 +232,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + // skl 21.08.2003 for reading G&DT //#include //#include @@ -264,6 +276,7 @@ TCollection_AsciiString AddrToString(const TopoDS_Shape& theShape) } #endif +static int numsize =0; //======================================================================= //function : IsEqual //purpose : global function to check equality of topological shapes @@ -1764,51 +1777,80 @@ static void ReadGDTPosition(const Interface_Graph &theGraph, gp_Dir aYDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3)); aPlaneAxes.SetDirection(aXDir.Crossed(aYDir)); aPlaneAxes.SetYDirection(aYDir); + //set location of the annotation plane + Handle(TColStd_HArray1OfReal) aLocCoords; + Handle(StepGeom_CartesianPoint) aLoc = aA2P3D->Location(); + gp_Pnt aLocPos( aLoc->CoordinatesValue (1), aLoc->CoordinatesValue (2), aLoc->CoordinatesValue (3)); + aPlaneAxes.SetLocation(aLocPos); isHasPlane = Standard_True; } } } // set plane axes to XCAF + if (isHasPlane) { if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) { - Handle(XCAFDimTolObjects_DimensionObject) anObj = - Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject); + Handle(XCAFDimTolObjects_DimensionObject) anObj = + Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject); + + Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt(1, 1); anObj->SetPlane(aPlaneAxes); + //aPnts->SetValue(1, aPlaneAxes.Location()); + //anObj->SetPoints(aPnts); + } else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) { Handle(XCAFDimTolObjects_DatumObject) anObj = Handle(XCAFDimTolObjects_DatumObject)::DownCast(theDimObject); anObj->SetPlane(aPlaneAxes); + //anObj->SetPoint(aPlaneAxes.Location()); } else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_GeomToleranceObject))) { Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject); anObj->SetPlane(aPlaneAxes); + //anObj->SetPoint(aPlaneAxes.Location()); } } - + + // Retrieve connecton point // Take AnnotationCurveOccurence (other types are not processed now) Handle(StepVisual_AnnotationCurveOccurrence) anACO; + NCollection_Vector aTesselations; if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) { anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(aDMIAE); + } else if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) { Handle(StepVisual_DraughtingCallout) aDCallout = Handle(StepVisual_DraughtingCallout)::DownCast(aDMIAE); for (Standard_Integer i = 1; i <= aDCallout->NbContents() && anACO.IsNull(); i++) { anACO = aDCallout->ContentsValue(i).AnnotationCurveOccurrence(); + if(anACO.IsNull()) + { + Handle(StepVisual_TessellatedAnnotationOccurrence) aTesselation = + aDCallout->ContentsValue(i).TessellatedAnnotationOccurrence(); + if( !aTesselation.IsNull()) + aTesselations.Append(aTesselation); + } } } - if (anACO.IsNull()) + if (anACO.IsNull() && !aTesselations.Length()) return; - // Take the first polyline (it is not a rule, but temporary solution) - Handle(StepRepr_RepresentationItem) aCurveItem = anACO->Item(); - Handle(StepGeom_Polyline) aCurve; + // for Dimensional_Location (and its subtypes) Standard_Boolean isDimLoc = theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation)); + gp_Pnt aPoint(0.,0.,0.); + gp_Pnt aPoint2(0.,0.,0.); + + if(!anACO.IsNull()) + { + // Take the first polyline (it is not a rule, but temporary solution) + Handle(StepRepr_RepresentationItem) aCurveItem = anACO->Item(); + Handle(StepGeom_Polyline) aCurve; Handle(StepGeom_Polyline) aCurve2; if (aCurveItem->IsKind(STANDARD_TYPE(StepShape_GeometricCurveSet))) { Handle(StepShape_GeometricCurveSet) aCurveSet = @@ -1834,7 +1876,7 @@ static void ReadGDTPosition(const Interface_Graph &theGraph, // Take the first point of polyline (it is not a rule, but temporary solution) Handle(StepGeom_CartesianPoint) aPnt = aCurve->PointsValue(1); Handle(TColStd_HArray1OfReal) aCoords = aPnt->Coordinates(); - gp_Pnt aPoint(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3)); + aPoint.SetCoord(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3)); gp_Pnt aPoint2; if (isDimLoc) { @@ -1842,11 +1884,91 @@ static void ReadGDTPosition(const Interface_Graph &theGraph, Handle(TColStd_HArray1OfReal) aCoords = aPnt->Coordinates(); aPoint2.SetCoord(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3)); } + } + //case of tesselated entities + else + { + gp_XYZ aXYZ1(0.,0.,0.),aXYZ2(0.,0.,0.) ; + + Standard_Integer nb = aTesselations.Length(), j =0, nbP =0; + for( ;j < nb; j++) + { + if( aTesselations(j).IsNull()) + continue; + Handle(TCollection_HAsciiString) aName = aTesselations(j)->Name(); + TCollection_AsciiString aCurName = aName.IsNull() ? + (TCollection_AsciiString("Size") + TCollection_AsciiString(numsize++)) : aName->String(); + aCurName += "_"; + aCurName += TCollection_AsciiString(j); + aCurName += ".brep"; + Handle(StepRepr_RepresentationItem) aTessItem = aTesselations(j)->Item(); + if(aTessItem.IsNull()) + return; + Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem); + if( aTessSet.IsNull()) + return; + NCollection_Handle aListItems = aTessSet->Items(); + Standard_Integer n = 1, nb = aListItems.IsNull() ? 0 : aListItems->Length(); + Handle(StepVisual_TessellatedCurveSet) aTessCurve; + for( ; n <= nb && aTessCurve.IsNull(); n++) + { + aTessCurve = Handle(StepVisual_TessellatedCurveSet)::DownCast(aListItems->Value(n)); + + } + if( aTessCurve.IsNull()) + return; + Handle(StepVisual_CoordinatesList) aCoordList = aTessCurve->CoordList(); + if( aCoordList.IsNull()) + return; + Handle(TColgp_HArray1OfXYZ) aPoints = aCoordList->Points(); + + isDimLoc = !aPoints.IsNull() && aPoints->Length() > 0; + if( isDimLoc) + { + //debug + NCollection_Handle aCurves = aTessCurve->Curves(); + Standard_Integer aNbC = (aCurves.IsNull() ? 0 : aCurves->Length()); + BRep_Builder aB; + TopoDS_Wire aCurW; + aB.MakeWire(aCurW); + Standard_Integer k = 1; + + + /* for( ; k < aPoints->Length(); k++) + { + gp_Pnt aP1(aPoints->Value(k)); + gp_Pnt aP2(aPoints->Value(k+1)); + BRepBuilderAPI_MakeEdge aMaker(aP1, aP2); + if( aMaker.IsDone()) + { + TopoDS_Edge aCurE = aMaker.Edge(); + aB.Add(aCurW, aCurE); + } + } + + BRepTools::Write(aCurW, aCurName.ToCString());*/ + // + aXYZ1 += aPoints->Value(1); + aXYZ2 += aPoints->Value(aPoints->Length()); + nbP++; + + + /* aPoint = gp_Pnt(aPoints->Value(1)); + aPoint2 = gp_Pnt(aPoints->Value(aPoints->Length()));*/ + } + } + if(nbP) + { + aPoint = gp_Pnt(aXYZ1/ nbP); + aPoint2 = gp_Pnt(aXYZ2/ nbP); + } + } // set point to XCAF if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) { Handle(XCAFDimTolObjects_DimensionObject) anObj = Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject); + Handle(TColgp_HArray1OfPnt) aPnts; if (isDimLoc) aPnts = new TColgp_HArray1OfPnt(1, 2); @@ -1854,7 +1976,11 @@ static void ReadGDTPosition(const Interface_Graph &theGraph, aPnts = new TColgp_HArray1OfPnt(1, 1); aPnts->SetValue(1, aPoint); if (isDimLoc) + { + aPnts->SetValue(1, aPoint); aPnts->SetValue(2, aPoint2); + } + anObj->SetPoints(aPnts); } else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) { @@ -1867,6 +1993,7 @@ static void ReadGDTPosition(const Interface_Graph &theGraph, Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject); anObj->SetPoint(aPoint); } + } //======================================================================= diff --git a/src/StepAP214/StepAP214_Protocol.cxx b/src/StepAP214/StepAP214_Protocol.cxx index 21ccf97423..fc9830cfb5 100644 --- a/src/StepAP214/StepAP214_Protocol.cxx +++ b/src/StepAP214/StepAP214_Protocol.cxx @@ -733,6 +733,12 @@ static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN"; #include +#include +#include +#include +#include +#include + static int init = 0; static Interface_DataMapOfTransientInteger types(800); @@ -1425,8 +1431,17 @@ StepAP214_Protocol::StepAP214_Protocol () types.Bind (STANDARD_TYPE(StepVisual_AnnotationPlane), 704); types.Bind (STANDARD_TYPE(StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol), 705); types.Bind (STANDARD_TYPE(StepDimTol_GeoTolAndGeoTolWthMaxTol), 706); + //AP242 tesselated + types.Bind (STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence), 707); + types.Bind (STANDARD_TYPE(StepVisual_TessellatedItem), 708); + types.Bind (STANDARD_TYPE(StepVisual_TessellatedGeometricSet), 709); + types.Bind (STANDARD_TYPE(StepVisual_TessellatedCurveSet), 710); + + types.Bind (STANDARD_TYPE(StepVisual_CoordinatesList), 711); } + + //======================================================================= //function : TypeNumber //purpose : diff --git a/src/StepVisual/FILES b/src/StepVisual/FILES index 510c28da56..7368423c57 100644 --- a/src/StepVisual/FILES +++ b/src/StepVisual/FILES @@ -208,3 +208,13 @@ StepVisual_TextStyleWithBoxCharacteristics.cxx StepVisual_TextStyleWithBoxCharacteristics.hxx StepVisual_ViewVolume.cxx StepVisual_ViewVolume.hxx +StepVisual_TessellatedAnnotationOccurrence.hxx +StepVisual_TessellatedAnnotationOccurrence.cxx +StepVisual_TessellatedItem.hxx +StepVisual_TessellatedItem.cxx +StepVisual_TessellatedGeometricSet.hxx +StepVisual_TessellatedGeometricSet.cxx +StepVisual_TessellatedCurveSet.hxx +StepVisual_TessellatedCurveSet.cxx +StepVisual_CoordinatesList.hxx +StepVisual_CoordinatesList.cxx diff --git a/src/StepVisual/StepVisual_AnnotationOccurrence.cxx b/src/StepVisual/StepVisual_AnnotationOccurrence.cxx index 6ac10ae417..449feb997b 100644 --- a/src/StepVisual/StepVisual_AnnotationOccurrence.cxx +++ b/src/StepVisual/StepVisual_AnnotationOccurrence.cxx @@ -19,3 +19,5 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_AnnotationOccurrence,StepVisual_StyledItem StepVisual_AnnotationOccurrence::StepVisual_AnnotationOccurrence () {} + + diff --git a/src/StepVisual/StepVisual_AnnotationOccurrence.hxx b/src/StepVisual/StepVisual_AnnotationOccurrence.hxx index ce1b8a693b..6565d1818d 100644 --- a/src/StepVisual/StepVisual_AnnotationOccurrence.hxx +++ b/src/StepVisual/StepVisual_AnnotationOccurrence.hxx @@ -38,7 +38,6 @@ public: - DEFINE_STANDARD_RTTIEXT(StepVisual_AnnotationOccurrence,StepVisual_StyledItem) protected: diff --git a/src/StepVisual/StepVisual_CoordinatesList.cxx b/src/StepVisual/StepVisual_CoordinatesList.cxx new file mode 100644 index 0000000000..954810eaf8 --- /dev/null +++ b/src/StepVisual/StepVisual_CoordinatesList.cxx @@ -0,0 +1,31 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include +#include +IMPLEMENT_STANDARD_RTTIEXT(StepVisual_CoordinatesList,StepGeom_TessellatedItem) + +StepVisual_CoordinatesList::StepVisual_CoordinatesList () {} + +void StepVisual_CoordinatesList::Init(const Handle(TCollection_HAsciiString)& theName,const Handle(TColgp_HArray1OfXYZ)& thePoints) +{ + StepRepr_RepresentationItem::Init(theName); + myPoints = thePoints; +} + +Handle(TColgp_HArray1OfXYZ) StepVisual_CoordinatesList::Points() const +{ + return myPoints; +} \ No newline at end of file diff --git a/src/StepVisual/StepVisual_CoordinatesList.hxx b/src/StepVisual/StepVisual_CoordinatesList.hxx new file mode 100644 index 0000000000..386eb132eb --- /dev/null +++ b/src/StepVisual/StepVisual_CoordinatesList.hxx @@ -0,0 +1,45 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _StepVisual_CoordinatesList_HeaderFile +#define _StepVisual_CoordinatesList_HeaderFile +#include +#include +#include +#include +#include +class Standard_Transient; + +DEFINE_STANDARD_HANDLE(StepVisual_CoordinatesList,StepVisual_TessellatedItem) +class StepVisual_CoordinatesList : public StepVisual_TessellatedItem +{ +public: + + DEFINE_STANDARD_ALLOC + + //! Returns a coordinate list + Standard_EXPORT StepVisual_CoordinatesList(); + + Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const Handle(TColgp_HArray1OfXYZ)& thePoints); + + Standard_EXPORT Handle(TColgp_HArray1OfXYZ) Points() const; + + DEFINE_STANDARD_RTTIEXT(StepVisual_CoordinatesList,StepVisual_TessellatedItem); + +private: + + Handle(TColgp_HArray1OfXYZ) myPoints; +}; +#endif // StepVisual_CoordinatesList diff --git a/src/StepVisual/StepVisual_DraughtingCalloutElement.cxx b/src/StepVisual/StepVisual_DraughtingCalloutElement.cxx index c4da000933..829b514e1f 100644 --- a/src/StepVisual/StepVisual_DraughtingCalloutElement.cxx +++ b/src/StepVisual/StepVisual_DraughtingCalloutElement.cxx @@ -17,6 +17,8 @@ #include #include +#include + //======================================================================= //function : StepVisual_DraughtingCalloutElement //purpose : @@ -33,8 +35,15 @@ Standard_Integer StepVisual_DraughtingCalloutElement::CaseNum(const Handle(Stand { if (ent.IsNull()) return 0; if (ent->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) return 1; + else if (ent->IsKind(STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence))) return 2; return 0; } Handle(StepVisual_AnnotationCurveOccurrence) StepVisual_DraughtingCalloutElement::AnnotationCurveOccurrence() const { return GetCasted(StepVisual_AnnotationCurveOccurrence,Value()); } + + + +Handle(StepVisual_TessellatedAnnotationOccurrence) StepVisual_DraughtingCalloutElement::TessellatedAnnotationOccurrence() const +{ return GetCasted(StepVisual_TessellatedAnnotationOccurrence,Value()); } + diff --git a/src/StepVisual/StepVisual_DraughtingCalloutElement.hxx b/src/StepVisual/StepVisual_DraughtingCalloutElement.hxx index 90fac0c4f0..772c9ad050 100644 --- a/src/StepVisual/StepVisual_DraughtingCalloutElement.hxx +++ b/src/StepVisual/StepVisual_DraughtingCalloutElement.hxx @@ -24,6 +24,7 @@ #include class Standard_Transient; class StepVisual_AnnotationCurveOccurrence; +class StepVisual_TessellatedAnnotationOccurrence; class StepVisual_DraughtingCalloutElement : public StepData_SelectType { @@ -41,5 +42,8 @@ public: //! returns Value as a AnnotationCurveOccurrence (Null if another type) Standard_EXPORT Handle(StepVisual_AnnotationCurveOccurrence) AnnotationCurveOccurrence() const; + + //! returns Value as a AnnotationOccurrence for Tesselated Anotation Occurence + Standard_EXPORT Handle(StepVisual_TessellatedAnnotationOccurrence) TessellatedAnnotationOccurrence() const; }; #endif // StepVisual_DraughtingCalloutElement diff --git a/src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.cxx b/src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.cxx new file mode 100644 index 0000000000..0435ec692a --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.cxx @@ -0,0 +1,21 @@ +// Created on: 2015-10-29 +// Created by: Irina KRYLOVA +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedAnnotationOccurrence,StepVisual_StyledItem); + +StepVisual_TessellatedAnnotationOccurrence::StepVisual_TessellatedAnnotationOccurrence () {} diff --git a/src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.hxx b/src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.hxx new file mode 100644 index 0000000000..1656db6b14 --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedAnnotationOccurrence.hxx @@ -0,0 +1,36 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _StepVisual_TessellatedAnnotationOccurrence_HeaderFile +#define _StepVisual_TessellatedAnnotationOccurrence_HeaderFile + +#include +#include + +#include + +class StepVisual_TessellatedAnnotationOccurrence; +DEFINE_STANDARD_HANDLE(StepVisual_TessellatedAnnotationOccurrence, StepVisual_StyledItem) + +class StepVisual_TessellatedAnnotationOccurrence : public StepVisual_StyledItem +{ +public: + + //! Returns a TesselatedAnnotationOccurence + Standard_EXPORT StepVisual_TessellatedAnnotationOccurrence(); + + DEFINE_STANDARD_RTTIEXT(StepVisual_TessellatedAnnotationOccurrence,StepVisual_StyledItem) +}; +#endif // _StepVisual_TesselatedAnnotationOccurrence_HeaderFile diff --git a/src/StepVisual/StepVisual_TessellatedCurveSet.cxx b/src/StepVisual/StepVisual_TessellatedCurveSet.cxx new file mode 100644 index 0000000000..174b20a4d9 --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedCurveSet.cxx @@ -0,0 +1,42 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include +#include + + +IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedCurveSet,StepVisual_TessellatedItem) + +StepVisual_TessellatedCurveSet::StepVisual_TessellatedCurveSet () {} + +void StepVisual_TessellatedCurveSet::Init(const Handle(TCollection_HAsciiString)& theName, + const Handle(StepVisual_CoordinatesList)& theCoordList, + const NCollection_Handle& theCurves) +{ + StepRepr_RepresentationItem::Init(theName); + myCoordList = theCoordList; + myCurves = theCurves; +} + + +NCollection_Handle StepVisual_TessellatedCurveSet::Curves() const +{ + return myCurves; +} + +Handle(StepVisual_CoordinatesList) StepVisual_TessellatedCurveSet::CoordList() const +{ + return myCoordList; +} \ No newline at end of file diff --git a/src/StepVisual/StepVisual_TessellatedCurveSet.hxx b/src/StepVisual/StepVisual_TessellatedCurveSet.hxx new file mode 100644 index 0000000000..a9b28b083e --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedCurveSet.hxx @@ -0,0 +1,60 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _StepVisual_TessellatedCurveSet_HeaderFile +#define _StepVisual_TessellatedCurveSet_HeaderFile +#include +#include +#include +#include +#include + +#include +#include +#include +#include +class Standard_Transient; + + +typedef NCollection_Vector StepVisual_VectorOfHSequenceOfInteger; + +DEFINE_STANDARD_HANDLE(StepVisual_TessellatedCurveSet, StepVisual_TessellatedItem); + + +class StepVisual_TessellatedCurveSet : public StepVisual_TessellatedItem +{ +public: + + DEFINE_STANDARD_ALLOC + + //! Returns a DraughtingCalloutElement select type + Standard_EXPORT StepVisual_TessellatedCurveSet(); + + Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const Handle(StepVisual_CoordinatesList)& theCoordList, + const NCollection_Handle& theCurves); + + Standard_EXPORT Handle(StepVisual_CoordinatesList) CoordList() const; + Standard_EXPORT NCollection_Handle Curves() const; + + +private: + + Handle(StepVisual_CoordinatesList) myCoordList; + NCollection_Handle myCurves; + +public : + DEFINE_STANDARD_RTTIEXT(StepVisual_TessellatedCurveSet,StepVisual_TessellatedItem); +}; +#endif // StepVisual_TessellatedCurveSet diff --git a/src/StepVisual/StepVisual_TessellatedGeometricSet.cxx b/src/StepVisual/StepVisual_TessellatedGeometricSet.cxx new file mode 100644 index 0000000000..68c86ece0f --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedGeometricSet.cxx @@ -0,0 +1,33 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include + + +IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedGeometricSet,StepGeom_TessellatedItem) + + +StepVisual_TessellatedGeometricSet::StepVisual_TessellatedGeometricSet () {} + +void StepVisual_TessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle& theItems) +{ + StepRepr_RepresentationItem::Init(theName); + myItems = theItems; +} + +NCollection_Handle StepVisual_TessellatedGeometricSet::Items() const +{ + return myItems; +} \ No newline at end of file diff --git a/src/StepVisual/StepVisual_TessellatedGeometricSet.hxx b/src/StepVisual/StepVisual_TessellatedGeometricSet.hxx new file mode 100644 index 0000000000..e7b98f6ef7 --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedGeometricSet.hxx @@ -0,0 +1,54 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _StepVisual_TessellatedGeometricSet_HeaderFile +#define _StepVisual_TessellatedGeometricSet_HeaderFile +#include +#include +#include + +#include +#include +//#include +#include + +class Standard_Transient; + +typedef NCollection_Array1 StepVisual_Array1OfTessellaltedItem; +//typedef NCollection_Handle Handle(StepVisual_Array1OfTessellaltedItem); + +//DEFINE_HARRAY1(StepVisual_HArray1OfTessellaltedItem, StepVisual_Array1OfTessellaltedItem) +DEFINE_STANDARD_HANDLE(StepVisual_TessellatedGeometricSet, StepVisual_TessellatedItem) +class StepVisual_TessellatedGeometricSet : public StepVisual_TessellatedItem +{ +public: + + DEFINE_STANDARD_ALLOC + + //! Returns a DraughtingCalloutElement select type + Standard_EXPORT StepVisual_TessellatedGeometricSet(); + + Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle& theItems); + + Standard_EXPORT NCollection_Handle Items() const; + +private: + NCollection_Handle myItems; + +public: + + DEFINE_STANDARD_RTTIEXT(StepVisual_TessellatedGeometricSet,StepVisual_TessellatedItem) +}; +#endif // StepVisual_TessellatedGeometricSet diff --git a/src/StepVisual/StepVisual_TessellatedItem.cxx b/src/StepVisual/StepVisual_TessellatedItem.cxx new file mode 100644 index 0000000000..51fd44b848 --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedItem.cxx @@ -0,0 +1,20 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedItem,StepGeom_GeometricRepresentationItem) + +StepVisual_TessellatedItem::StepVisual_TessellatedItem () {} \ No newline at end of file diff --git a/src/StepVisual/StepVisual_TessellatedItem.hxx b/src/StepVisual/StepVisual_TessellatedItem.hxx new file mode 100644 index 0000000000..81fe88d6a3 --- /dev/null +++ b/src/StepVisual/StepVisual_TessellatedItem.hxx @@ -0,0 +1,37 @@ +// Created on: 2015-10-29 +// Created by: Galina Kulikova +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _StepVisual_TessellatedItem_HeaderFile +#define _StepVisual_TessellatedItem_HeaderFile +#include +#include +#include + +#include +class Standard_Transient; + +DEFINE_STANDARD_HANDLE(StepVisual_TessellatedItem, StepGeom_GeometricRepresentationItem) +class StepVisual_TessellatedItem : public StepGeom_GeometricRepresentationItem +{ +public: + + DEFINE_STANDARD_ALLOC + + //! Returns a DraughtingCalloutElement select type + Standard_EXPORT StepVisual_TessellatedItem(); + + DEFINE_STANDARD_RTTIEXT(StepVisual_TessellatedItem,StepGeom_GeometricRepresentationItem); +}; +#endif // StepVisual_TessellatedItem diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx index e65fee84a2..3549cfbf4e 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx @@ -135,7 +135,7 @@ public: Standard_Boolean HasPlane() const { return myHasPlane; } - Standard_Boolean HasPoints() const { !myPnts.IsNull() && myPnts->Length() > 0; } + Standard_Boolean HasPoints() const { return (!myPnts.IsNull() && myPnts->Length() > 0); } Standard_Boolean HasPoint2() const { return myHasPnt2; } diff --git a/src/XCAFDoc/XCAFDoc_Dimension.cxx b/src/XCAFDoc/XCAFDoc_Dimension.cxx index 2c52517ff4..70224613c4 100644 --- a/src/XCAFDoc/XCAFDoc_Dimension.cxx +++ b/src/XCAFDoc/XCAFDoc_Dimension.cxx @@ -300,13 +300,15 @@ Handle(XCAFDimTolObjects_DimensionObject) XCAFDoc_Dimension::GetObject() const Handle(TDataStd_RealArray) aPnts; if(Label().FindChild(ChildLab_Pnts).FindAttribute(TDataStd_RealArray::GetID(), aPnts) - && !aPnts->Array().IsNull() && aPnts->Array()->Length() > 0) + && !aPnts->Array().IsNull() && aPnts->Array()->Length() > 2) { - Handle(TColgp_HArray1OfPnt) aP = new TColgp_HArray1OfPnt(1,aPnts->Array()->Length()); - aP->SetValue(1, gp_Pnt(aPnts->Array()->Value(1), aPnts->Array()->Value(2), aPnts->Array()->Value(3))); - if (aPnts->Array()->Length() == 2) + Handle(TColgp_HArray1OfPnt) aP = new TColgp_HArray1OfPnt(1,aPnts->Array()->Length()/3); + gp_Pnt aP1(aPnts->Array()->Value(1), aPnts->Array()->Value(2), aPnts->Array()->Value(3)); + aP->SetValue(1, aP1); + if (aPnts->Array()->Length() == 6) { - aP->SetValue(2, gp_Pnt(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6))); + gp_Pnt aP2(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6)); + aP->SetValue(2, aP2); } anObj->SetPoints(aP); } -- 2.39.5