mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0027455: Implementation of connection points
Add Import/Export connection points. Make some improvements in STEP reading in collections shapes, to which dimension is attached. Update tests.
This commit is contained in:
@@ -354,6 +354,8 @@
|
||||
#include <RWStepRepr_RWCompoundRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWConfigurationDesign.hxx>
|
||||
#include <RWStepRepr_RWConfigurationEffectivity.hxx>
|
||||
#include <RWStepRepr_RWConstructiveGeometryRepresentation.hxx>
|
||||
#include <RWStepRepr_RWConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <RWStepRepr_RWDataEnvironment.hxx>
|
||||
#include <RWStepRepr_RWDefinitionalRepresentation.hxx>
|
||||
#include <RWStepRepr_RWDerivedShapeAspect.hxx>
|
||||
@@ -888,6 +890,8 @@
|
||||
#include <StepRepr_CompoundRepresentationItem.hxx>
|
||||
#include <StepRepr_ConfigurationDesign.hxx>
|
||||
#include <StepRepr_ConfigurationEffectivity.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_DataEnvironment.hxx>
|
||||
#include <StepRepr_DefinitionalRepresentation.hxx>
|
||||
#include <StepRepr_DerivedShapeAspect.hxx>
|
||||
@@ -5083,6 +5087,20 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 712:
|
||||
{
|
||||
DeclareAndCast(StepRepr_ConstructiveGeometryRepresentation,anent,ent);
|
||||
RWStepRepr_RWConstructiveGeometryRepresentation tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 713:
|
||||
{
|
||||
DeclareAndCast(StepRepr_ConstructiveGeometryRepresentationRelationship,anent,ent);
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
@@ -7059,17 +7077,25 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
ent = new StepVisual_TessellatedItem;
|
||||
break;
|
||||
|
||||
case 709:
|
||||
ent = new StepVisual_TessellatedGeometricSet;
|
||||
break;
|
||||
case 709:
|
||||
ent = new StepVisual_TessellatedGeometricSet;
|
||||
break;
|
||||
|
||||
case 710:
|
||||
ent = new StepVisual_TessellatedCurveSet;
|
||||
break;
|
||||
|
||||
case 711:
|
||||
ent = new StepVisual_CoordinatesList;
|
||||
break;
|
||||
case 710:
|
||||
ent = new StepVisual_TessellatedCurveSet;
|
||||
break;
|
||||
|
||||
case 711:
|
||||
ent = new StepVisual_CoordinatesList;
|
||||
break;
|
||||
|
||||
case 712:
|
||||
ent = new StepRepr_ConstructiveGeometryRepresentation;
|
||||
break;
|
||||
|
||||
case 713:
|
||||
ent = new StepRepr_ConstructiveGeometryRepresentationRelationship;
|
||||
break;
|
||||
|
||||
default:
|
||||
return Standard_False;
|
||||
@@ -7660,8 +7686,9 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber
|
||||
case 708:
|
||||
case 709:
|
||||
case 710:
|
||||
case 711:
|
||||
return cataux;
|
||||
case 711: return cataux;
|
||||
case 712:
|
||||
case 713: return catsh;
|
||||
|
||||
default : break;
|
||||
}
|
||||
|
@@ -1381,12 +1381,16 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <StepVisual_TessellatedGeometricSet.hxx>
|
||||
#include <StepVisual_TessellatedCurveSet.hxx>
|
||||
#include <StepVisual_CoordinatesList.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
|
||||
#include <RWStepVisual_RWTessellatedAnnotationOccurrence.hxx>
|
||||
#include <RWStepVisual_RWTessellatedItem.hxx>
|
||||
#include <RWStepVisual_RWTessellatedGeometricSet.hxx>
|
||||
#include <RWStepVisual_RWTessellatedCurveSet.hxx>
|
||||
#include <RWStepVisual_RWCoordinatesList.hxx>
|
||||
#include <RWStepRepr_RWConstructiveGeometryRepresentation.hxx>
|
||||
#include <RWStepRepr_RWConstructiveGeometryRepresentationRelationship.hxx>
|
||||
|
||||
// -- General Declarations (Recognize, StepType) ---
|
||||
|
||||
@@ -2022,6 +2026,8 @@ static TCollection_AsciiString Reco_TessellatedAnnotationOccurrence("TESSELLATED
|
||||
static TCollection_AsciiString Reco_TessellatedGeometricSet("TESSELLATED_GEOMETRIC_SET");
|
||||
static TCollection_AsciiString Reco_TessellatedCurveSet("TESSELLATED_CURVE_SET");
|
||||
static TCollection_AsciiString Reco_CoordinatesList("COORDINATES_LIST");
|
||||
static TCollection_AsciiString Reco_ConstructiveGeometryRepresentation("CONSTRUCTIVE_GEOMETRY_REPRESENTATION");
|
||||
static TCollection_AsciiString Reco_ConstructiveGeometryRepresentationRelationship("CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP");
|
||||
// -- Definition of the libraries --
|
||||
|
||||
static Handle(Dico_DictionaryOfInteger) typenums;
|
||||
@@ -2673,6 +2679,8 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
|
||||
|
||||
typenums->SetItem ( Reco_TessellatedCurveSet, 710);
|
||||
typenums->SetItem ( Reco_CoordinatesList, 711);
|
||||
typenums->SetItem ( Reco_ConstructiveGeometryRepresentation, 712);
|
||||
typenums->SetItem ( Reco_ConstructiveGeometryRepresentationRelationship, 713);
|
||||
|
||||
|
||||
// SHORT NAMES
|
||||
@@ -3214,6 +3222,8 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
|
||||
typeshor->SetItem ("VLRPIT",701);
|
||||
typeshor->SetItem ("DMIA", 703);
|
||||
typeshor->SetItem ("ANNPLN", 704);
|
||||
typeshor->SetItem ("CNGMRP", 712);
|
||||
typeshor->SetItem ("CGRR", 713);
|
||||
|
||||
}
|
||||
|
||||
@@ -4492,6 +4502,8 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
|
||||
|
||||
case 710 : return Reco_TessellatedCurveSet;
|
||||
case 711 : return Reco_CoordinatesList;
|
||||
case 712 : return Reco_ConstructiveGeometryRepresentation;
|
||||
case 713 : return Reco_ConstructiveGeometryRepresentationRelationship;
|
||||
|
||||
default : return PasReco;
|
||||
}
|
||||
@@ -9309,6 +9321,20 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 712:
|
||||
{
|
||||
DeclareAndCast(StepRepr_ConstructiveGeometryRepresentation,anent,ent);
|
||||
RWStepRepr_RWConstructiveGeometryRepresentation tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 713:
|
||||
{
|
||||
DeclareAndCast(StepRepr_ConstructiveGeometryRepresentationRelationship,anent,ent);
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ach->AddFail("Type Mismatch when reading - Entity");
|
||||
@@ -14093,7 +14119,20 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
DeclareAndCast(StepVisual_CoordinatesList,anent,ent);
|
||||
RWStepVisual_RWCoordinatesList tool;
|
||||
tool.WriteStep(SW,anent);
|
||||
|
||||
}
|
||||
break;
|
||||
case 712:
|
||||
{
|
||||
DeclareAndCast(StepRepr_ConstructiveGeometryRepresentation,anent,ent);
|
||||
RWStepRepr_RWConstructiveGeometryRepresentation tool;
|
||||
tool.WriteStep(SW,anent);
|
||||
}
|
||||
break;
|
||||
case 713:
|
||||
{
|
||||
DeclareAndCast(StepRepr_ConstructiveGeometryRepresentationRelationship,anent,ent);
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship tool;
|
||||
tool.WriteStep(SW,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -26,6 +26,10 @@ RWStepRepr_RWConfigurationEffectivity.cxx
|
||||
RWStepRepr_RWConfigurationEffectivity.hxx
|
||||
RWStepRepr_RWConfigurationItem.cxx
|
||||
RWStepRepr_RWConfigurationItem.hxx
|
||||
RWStepRepr_RWConstructiveGeometryRepresentation.cxx
|
||||
RWStepRepr_RWConstructiveGeometryRepresentation.hxx
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship.cxx
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship.hxx
|
||||
RWStepRepr_RWContinuosShapeAspect.cxx
|
||||
RWStepRepr_RWContinuosShapeAspect.hxx
|
||||
RWStepRepr_RWDataEnvironment.cxx
|
||||
|
@@ -0,0 +1,106 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepRepr_RWConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <StepRepr_RepresentationContext.hxx>
|
||||
#include <StepRepr_RepresentationItem.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepRepr_RWConstructiveGeometryRepresentation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepRepr_RWConstructiveGeometryRepresentation::RWStepRepr_RWConstructiveGeometryRepresentation () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepRepr_RWConstructiveGeometryRepresentation::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentation)& ent) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!data->CheckNbParams(num, 3, ach, "constructive_geometry_representation")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name" ,ach, aName);
|
||||
|
||||
// Inherited field : items
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aItems;
|
||||
Handle(StepRepr_RepresentationItem) anEnt;
|
||||
Standard_Integer nsub;
|
||||
if (data->ReadSubList (num, 2, "items", ach, nsub)) {
|
||||
Standard_Integer nb = data->NbParams(nsub);
|
||||
aItems = new StepRepr_HArray1OfRepresentationItem (1, nb);
|
||||
for (Standard_Integer i = 1; i <= nb; i ++) {
|
||||
if (data->ReadEntity (nsub, i, "representation_item", ach,
|
||||
STANDARD_TYPE(StepRepr_RepresentationItem), anEnt))
|
||||
aItems->SetValue(i, anEnt);
|
||||
}
|
||||
}
|
||||
|
||||
// Inherited field : context_of_items
|
||||
Handle(StepRepr_RepresentationContext) aContextOfItems;
|
||||
data->ReadEntity(num, 3,"context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aContextOfItems);
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aItems, aContextOfItems);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepRepr_RWConstructiveGeometryRepresentation::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentation)& ent) const
|
||||
{
|
||||
// Inherited field : name
|
||||
SW.Send(ent->Name());
|
||||
|
||||
// Inherited field : items
|
||||
SW.OpenSub();
|
||||
for (Standard_Integer i = 1; i <= ent->NbItems(); i++) {
|
||||
SW.Send(ent->ItemsValue(i));
|
||||
}
|
||||
SW.CloseSub();
|
||||
|
||||
// Inherited field : context_of_items
|
||||
SW.Send(ent->ContextOfItems());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepRepr_RWConstructiveGeometryRepresentation::Share(const Handle(StepRepr_ConstructiveGeometryRepresentation)& ent, Interface_EntityIterator& iter) const
|
||||
{
|
||||
Standard_Integer nbElem = ent->NbItems();
|
||||
for (Standard_Integer i = 1; i <= nbElem; i++) {
|
||||
iter.GetOneItem(ent->ItemsValue(i));
|
||||
}
|
||||
iter.GetOneItem(ent->ContextOfItems());
|
||||
}
|
||||
|
@@ -0,0 +1,48 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 _RWStepRepr_RWConstructiveGeometryRepresentation_HeaderFile
|
||||
#define _RWStepRepr_RWConstructiveGeometryRepresentation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_ConstructiveGeometryRepresentation;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Read & Write Module for ConstructiveGeometryRepresentation
|
||||
class RWStepRepr_RWConstructiveGeometryRepresentation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWConstructiveGeometryRepresentation();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepRepr_ConstructiveGeometryRepresentation)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepRepr_ConstructiveGeometryRepresentation)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepRepr_ConstructiveGeometryRepresentation)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
};
|
||||
#endif // _RWStepRepr_RWConstructiveGeometryRepresentation_HeaderFile
|
@@ -0,0 +1,80 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepRepr_RWConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship::
|
||||
RWStepRepr_RWConstructiveGeometryRepresentationRelationship () {}
|
||||
|
||||
void RWStepRepr_RWConstructiveGeometryRepresentationRelationship::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& ent) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!data->CheckNbParams(num, 4, ach, "constructive_geometry_representation_relationship")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name" ,ach, aName);
|
||||
|
||||
// Inherited field : description
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
if (data->IsParamDefined (num, 2)) {
|
||||
data->ReadString (num, 2, "description", ach, aDescription);
|
||||
}
|
||||
// Inherited field : rep_1
|
||||
Handle(StepRepr_Representation) aRep1;
|
||||
data->ReadEntity(num, 3, "rep_1", ach, STANDARD_TYPE(StepRepr_Representation), aRep1);
|
||||
|
||||
// Inherited field : rep_2
|
||||
Handle(StepRepr_Representation) aRep2;
|
||||
data->ReadEntity(num, 4,"rep_2", ach, STANDARD_TYPE(StepRepr_Representation), aRep2);
|
||||
|
||||
// Initialisation of the read entity
|
||||
ent->Init(aName, aDescription, aRep1, aRep2);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWConstructiveGeometryRepresentationRelationship::WriteStep
|
||||
(StepData_StepWriter& SW,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& ent) const
|
||||
{
|
||||
// Inherited field : name
|
||||
SW.Send(ent->Name());
|
||||
|
||||
// Inherited field : description
|
||||
SW.Send(ent->Description());
|
||||
|
||||
// Inherited field : rep_1
|
||||
SW.Send(ent->Rep1());
|
||||
|
||||
// Inherited field : rep_2
|
||||
SW.Send(ent->Rep2());
|
||||
}
|
||||
|
||||
void RWStepRepr_RWConstructiveGeometryRepresentationRelationship::Share
|
||||
(const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
iter.GetOneItem(ent->Rep1());
|
||||
iter.GetOneItem(ent->Rep2());
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 _RWStepRepr_RWConstructiveGeometryRepresentationRelationship_HeaderFile
|
||||
#define _RWStepRepr_RWConstructiveGeometryRepresentationRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_ConstructiveGeometryRepresentationRelationship;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Read & Write Module for ConstructiveGeometryRepresentationRelationship
|
||||
class RWStepRepr_RWConstructiveGeometryRepresentationRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWConstructiveGeometryRepresentationRelationship();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& ent) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& ent) const;
|
||||
|
||||
Standard_EXPORT void Share (const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
};
|
||||
#endif // _RWStepRepr_RWConstructiveGeometryRepresentationRelationship_HeaderFile
|
@@ -103,6 +103,7 @@
|
||||
#include <StepRepr_AssemblyComponentUsage.hxx>
|
||||
#include <StepRepr_CharacterizedDefinition.hxx>
|
||||
#include <StepRepr_CompoundRepresentationItem.hxx>
|
||||
#include <StepRepr_DerivedShapeAspect.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
#include <StepRepr_MeasureRepresentationItem.hxx>
|
||||
@@ -119,6 +120,7 @@
|
||||
#include <StepRepr_ReprItemAndPlaneAngleMeasureWithUnit.hxx>
|
||||
#include <StepRepr_SequenceOfRepresentationItem.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectDerivingRelationship.hxx>
|
||||
#include <StepRepr_CompositeShapeAspect.hxx>
|
||||
#include <StepRepr_AllAroundShapeAspect.hxx>
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
@@ -1724,7 +1726,7 @@ static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
|
||||
|
||||
//=======================================================================
|
||||
//function : readAnnotation
|
||||
//purpose : return annotation plane and position for given GDT
|
||||
//purpose : read annotation plane and position for given GDT
|
||||
// (Dimension, Geometric_Tolerance, Datum_Feature or Placed_Datum_Target_Feature)
|
||||
//=======================================================================
|
||||
void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
|
||||
@@ -1983,6 +1985,97 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
|
||||
return;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : readConnectionPoints
|
||||
//purpose : read connection points for given dimension
|
||||
//=======================================================================
|
||||
void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
|
||||
const Handle(Standard_Transient) theGDT,
|
||||
const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject)
|
||||
{
|
||||
Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
|
||||
const Interface_Graph& aGraph = aTP->Graph();
|
||||
|
||||
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
|
||||
// retrieve derived geometry
|
||||
Handle(StepShape_DimensionalSize) aDim = Handle(StepShape_DimensionalSize)::DownCast(theGDT);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->AppliesTo());
|
||||
if (aDSA.IsNull())
|
||||
return;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = NULL;
|
||||
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA); aGISU.IsNull() && anIt.More(); anIt.Next()) {
|
||||
aGISU = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
}
|
||||
if (aGISU.IsNull() || aGISU->NbIdentifiedItem() == 0)
|
||||
return;
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU->IdentifiedItem()->Value(1));
|
||||
if (aPoint.IsNull()) {
|
||||
// try Axis2Placement3d.location instead of CartesianPoint
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D =
|
||||
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU->IdentifiedItem()->Value(1));
|
||||
if (anA2P3D.IsNull())
|
||||
return;
|
||||
aPoint = anA2P3D->Location();
|
||||
}
|
||||
|
||||
// set connection point to object
|
||||
gp_Pnt aPnt(aPoint->CoordinatesValue(1), aPoint->CoordinatesValue(2), aPoint->CoordinatesValue(3));
|
||||
theDimObject->SetPoint(aPnt);
|
||||
}
|
||||
else if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation))) {
|
||||
// retrieve derived geometry
|
||||
Handle(StepShape_DimensionalLocation) aDim = Handle(StepShape_DimensionalLocation)::DownCast(theGDT);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA1 = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->RelatingShapeAspect());
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA2 = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->RelatedShapeAspect());
|
||||
if (aDSA1.IsNull() && aDSA2.IsNull())
|
||||
return;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU1 = NULL;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU2 = NULL;
|
||||
if (!aDSA1.IsNull()) {
|
||||
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA1); aGISU1.IsNull() && anIt.More(); anIt.Next()) {
|
||||
aGISU1 = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
}
|
||||
}
|
||||
if (!aDSA2.IsNull()) {
|
||||
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA2); aGISU2.IsNull() && anIt.More(); anIt.Next()) {
|
||||
aGISU2 = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
}
|
||||
}
|
||||
// first point
|
||||
if (!aGISU1.IsNull() && aGISU1->NbIdentifiedItem() > 0) {
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU1->IdentifiedItem()->Value(1));
|
||||
if (aPoint.IsNull()) {
|
||||
// try Axis2Placement3d.location instead of CartesianPoint
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D =
|
||||
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU1->IdentifiedItem()->Value(1));
|
||||
if (!anA2P3D.IsNull())
|
||||
aPoint = anA2P3D->Location();
|
||||
}
|
||||
if (!aPoint.IsNull()) {
|
||||
// set connection point to object
|
||||
gp_Pnt aPnt(aPoint->CoordinatesValue(1), aPoint->CoordinatesValue(2), aPoint->CoordinatesValue(3));
|
||||
theDimObject->SetPoint(aPnt);
|
||||
}
|
||||
}
|
||||
// second point
|
||||
if (!aGISU2.IsNull() && aGISU2->NbIdentifiedItem() > 0) {
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU2->IdentifiedItem()->Value(1));
|
||||
if (aPoint.IsNull()) {
|
||||
// try Axis2Placement3d.location instead of CartesianPoint
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D =
|
||||
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU2->IdentifiedItem()->Value(1));
|
||||
if (!anA2P3D.IsNull())
|
||||
aPoint = anA2P3D->Location();
|
||||
}
|
||||
if (!aPoint.IsNull()) {
|
||||
// set connection point to object
|
||||
gp_Pnt aPnt(aPoint->CoordinatesValue(1), aPoint->CoordinatesValue(2), aPoint->CoordinatesValue(3));
|
||||
theDimObject->SetPoint2(aPnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadDatums
|
||||
//purpose : auxilary
|
||||
@@ -2433,7 +2526,49 @@ static Standard_Boolean readDatumsAP242(const Handle(Standard_Transient)& theEnt
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : craeteGeomTolObjectInXCAF
|
||||
//function : collectShapeAspect
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static void collectShapeAspect(const Handle(StepRepr_ShapeAspect)& theSA,
|
||||
const Handle(XSControl_WorkSession)& theWS,
|
||||
NCollection_Sequence<Handle(StepRepr_ShapeAspect)>& theSAs)
|
||||
{
|
||||
Handle(XSControl_TransferReader) aTR = theWS->TransferReader();
|
||||
Handle(Transfer_TransientProcess) aTP = aTR->TransientProcess();
|
||||
const Interface_Graph& aGraph = aTP->Graph();
|
||||
// Retrieve Shape_Aspect, connected to Representation_Item from Derived_Shape_Aspect
|
||||
if (theSA->IsKind(STANDARD_TYPE(StepRepr_DerivedShapeAspect))) {
|
||||
Interface_EntityIterator anIter = aGraph.Sharings(theSA);
|
||||
Handle(StepRepr_ShapeAspectDerivingRelationship) aSADR = NULL;
|
||||
for (; aSADR.IsNull() && anIter.More(); anIter.Next()) {
|
||||
aSADR = Handle(StepRepr_ShapeAspectDerivingRelationship)::DownCast(anIter.Value());
|
||||
}
|
||||
if (!aSADR.IsNull())
|
||||
collectShapeAspect(aSADR->RelatedShapeAspect(), theWS, theSAs);
|
||||
}
|
||||
else {
|
||||
// Find all children Shape_Aspect
|
||||
Standard_Boolean isSimple = Standard_True;
|
||||
Interface_EntityIterator anIter = aGraph.Sharings(theSA);
|
||||
for (; anIter.More(); anIter.Next()) {
|
||||
if (anIter.Value()->IsKind(STANDARD_TYPE(StepRepr_ShapeAspectRelationship)) &&
|
||||
!anIter.Value()->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation))) {
|
||||
Handle(StepRepr_ShapeAspectRelationship) aSAR =
|
||||
Handle(StepRepr_ShapeAspectRelationship)::DownCast(anIter.Value());
|
||||
if (aSAR->RelatingShapeAspect() == theSA) {
|
||||
collectShapeAspect(aSAR->RelatedShapeAspect(), theWS, theSAs);
|
||||
isSimple = Standard_False;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If not Composite_Shape_Aspect (or subtype) append to sequence.
|
||||
if (isSimple)
|
||||
theSAs.Append(theSA);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : createGeomTolObjectInXCAF
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
@@ -2459,6 +2594,7 @@ static TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
// find RepresentationItem for current Ent
|
||||
NCollection_Sequence<Handle(Standard_Transient)> aSeqRI1, aSeqRI2;
|
||||
|
||||
// Collect all Shape_Aspect entities
|
||||
Interface_EntityIterator anIter = aGraph.Shareds(theEnt);
|
||||
for(anIter.Start(); anIter.More(); anIter.Next()) {
|
||||
Handle(Standard_Transient) anAtr = anIter.Value();
|
||||
@@ -2492,69 +2628,27 @@ static TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
Interface_EntityIterator anIterDim = aGraph.Shareds(anAtr);
|
||||
for(anIterDim.Start(); anIterDim.More(); anIterDim.Next())
|
||||
{
|
||||
Handle(Standard_Transient) anAtrDim = anIterDim.Value();
|
||||
if(anAtrDim->IsKind(STANDARD_TYPE(StepRepr_CompositeShapeAspect)) ||
|
||||
anAtrDim->IsKind(STANDARD_TYPE(StepRepr_CompShAspAndDatumFeatAndShAsp)))
|
||||
{
|
||||
Interface_EntityIterator anIterCSA = aGraph.Sharings(anAtrDim);
|
||||
for(anIterCSA.Start(); anIterCSA.More(); anIterCSA.Next()) {
|
||||
if (anIterCSA.Value()->IsKind(STANDARD_TYPE(StepRepr_ShapeAspectRelationship))){
|
||||
Interface_EntityIterator anIterSAR = aGraph.Shareds(anIterCSA.Value());
|
||||
for(anIterSAR.Start(); anIterSAR.More(); anIterSAR.Next()) {
|
||||
if (anIterSAR.Value()->IsKind(STANDARD_TYPE(StepRepr_ShapeAspect))){
|
||||
aSAs.Append(Handle(StepRepr_ShapeAspect)::DownCast(anIterSAR.Value()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(anAtrDim->IsKind(STANDARD_TYPE(StepRepr_ShapeAspect)))
|
||||
{
|
||||
aSAs.Append( Handle(StepRepr_ShapeAspect)::DownCast(anAtrDim));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(anAtr->IsKind(STANDARD_TYPE(StepRepr_CompositeShapeAspect)) ||
|
||||
anAtr->IsKind(STANDARD_TYPE(StepRepr_CompShAspAndDatumFeatAndShAsp)))
|
||||
{
|
||||
//processing for composite entity
|
||||
Handle(Standard_Transient) anAtrTmp = anAtr;
|
||||
if(anAtr->IsKind(STANDARD_TYPE(StepRepr_AllAroundShapeAspect)))
|
||||
{
|
||||
// if applyed AllAround Modifier
|
||||
isAllAround = Standard_True;
|
||||
Interface_EntityIterator anIterAASA = aGraph.Sharings(anAtrTmp);
|
||||
for(anIterAASA.Start(); anIterAASA.More(); anIterAASA.Next()) {
|
||||
if (anIterAASA.Value()->IsKind(STANDARD_TYPE(StepRepr_ShapeAspectRelationship))){
|
||||
Interface_EntityIterator anIterSAR = aGraph.Shareds(anIterAASA.Value());
|
||||
for(anIterSAR.Start(); anIterSAR.More(); anIterSAR.Next()) {
|
||||
if ((anIterSAR.Value()->IsKind(STANDARD_TYPE(StepRepr_CompositeShapeAspect)) ||
|
||||
anIterSAR.Value()->IsKind(STANDARD_TYPE(StepRepr_CompShAspAndDatumFeatAndShAsp))) &&
|
||||
anAtrTmp != anIterSAR.Value()){
|
||||
anAtrTmp = anIterSAR.Value();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Interface_EntityIterator anIterCSA = aGraph.Sharings(anAtrTmp);
|
||||
for(anIterCSA.Start(); anIterCSA.More(); anIterCSA.Next()) {
|
||||
if (anIterCSA.Value()->IsKind(STANDARD_TYPE(StepRepr_ShapeAspectRelationship))){
|
||||
Interface_EntityIterator anIterSAR = aGraph.Shareds(anIterCSA.Value());
|
||||
for(anIterSAR.Start(); anIterSAR.More(); anIterSAR.Next()) {
|
||||
if (anIterSAR.Value()->IsKind(STANDARD_TYPE(StepRepr_ShapeAspect))){
|
||||
aSAs.Append(Handle(StepRepr_ShapeAspect)::DownCast(anIterSAR.Value()));
|
||||
}
|
||||
}
|
||||
Handle(StepRepr_ShapeAspect) aSA = Handle(StepRepr_ShapeAspect)::DownCast(anIterDim.Value());
|
||||
if(!aSA.IsNull()) {
|
||||
collectShapeAspect(aSA, theWS, aSAs);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(anAtr->IsKind(STANDARD_TYPE(StepRepr_ShapeAspect)))
|
||||
{
|
||||
//default
|
||||
aSAs.Append( Handle(StepRepr_ShapeAspect)::DownCast(anAtr));
|
||||
if(anAtr->IsKind(STANDARD_TYPE(StepRepr_AllAroundShapeAspect)))
|
||||
{
|
||||
// if applyed AllAround Modifier
|
||||
isAllAround = Standard_True;
|
||||
}
|
||||
// dimensions and default tolerances
|
||||
Handle(StepRepr_ShapeAspect) aSA = Handle(StepRepr_ShapeAspect)::DownCast(anAtr);
|
||||
if(!aSA.IsNull()) {
|
||||
collectShapeAspect(aSA, theWS, aSAs);
|
||||
}
|
||||
}
|
||||
|
||||
// Collect all representation items
|
||||
if(!aSAs.IsEmpty())
|
||||
{
|
||||
//get representation items
|
||||
@@ -2767,8 +2861,8 @@ static TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
else
|
||||
{
|
||||
if(aGISU.IsNull()) continue;
|
||||
if(aGISU->NbIdentifiedItem() > 0) {
|
||||
aSeqRI.Append(aGISU->IdentifiedItemValue(1));
|
||||
for (Standard_Integer i = 1; i <= aGISU->NbIdentifiedItem(); i++) {
|
||||
aSeqRI.Append(aGISU->IdentifiedItemValue(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2785,6 +2879,7 @@ static TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
|
||||
TDF_LabelSequence aShLS1, aShLS2;
|
||||
|
||||
// Collect shapes
|
||||
for(Standard_Integer i = aSeqRI1.Lower(); i <= aSeqRI1.Upper() ;i++)
|
||||
{
|
||||
Standard_Integer anIndex = aTP->MapIndex(aSeqRI1.Value(i));
|
||||
@@ -3058,7 +3153,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
}
|
||||
else
|
||||
{
|
||||
// calss of tolerance
|
||||
// class of tolerance
|
||||
aLAF = aTMD.LimitsAndFits();
|
||||
}
|
||||
}
|
||||
@@ -3249,6 +3344,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
|
||||
if(aDimL.FindAttribute(XCAFDoc_Dimension::GetID(),aDim))
|
||||
{
|
||||
readAnnotation(aTR, theEnt, aDimObj);
|
||||
readConnectionPoints(aTR, theEnt, aDimObj);
|
||||
aDim->SetObject(aDimObj);
|
||||
}
|
||||
}
|
||||
|
@@ -112,6 +112,9 @@
|
||||
#include <StepGeom_Surface.hxx>
|
||||
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_CompositeShapeAspect.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_DerivedShapeAspect.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_HArray1OfRepresentationItem.hxx>
|
||||
@@ -127,6 +130,7 @@
|
||||
#include <StepRepr_ReprItemAndPlaneAngleMeasureWithUnit.hxx>
|
||||
#include <StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectDerivingRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
|
||||
#include <StepRepr_ValueRange.hxx>
|
||||
@@ -2703,7 +2707,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession) &WS,
|
||||
Handle(StepGeom_Axis2Placement3d) anOrientation = new StepGeom_Axis2Placement3d();
|
||||
gp_Dir aDir;
|
||||
theObject->GetDirection(aDir);
|
||||
GeomToStep_MakeCartesianPoint MkPoint(theObject->GetPoints()->Value(1));
|
||||
GeomToStep_MakeCartesianPoint MkPoint(gp_Pnt(0, 0, 0));
|
||||
Handle(StepGeom_CartesianPoint) aLoc = MkPoint.Value();
|
||||
Handle(StepGeom_Direction) anAxis = new StepGeom_Direction();
|
||||
Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3);
|
||||
@@ -2785,6 +2789,59 @@ static void WriteDimValues(const Handle(XSControl_WorkSession) &WS,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteDerivedGeometry
|
||||
//purpose : auxiliary (write connection point for dimensions)
|
||||
//======================================================================
|
||||
static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
|
||||
const Handle(XCAFDimTolObjects_DimensionObject)& theObject,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentation) theRepr,
|
||||
Handle(StepRepr_ShapeAspect)& theFirstSA,
|
||||
Handle(StepRepr_ShapeAspect)& theSecondSA,
|
||||
NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
|
||||
{
|
||||
const Handle(Interface_InterfaceModel) &aModel = WS->Model();
|
||||
// First point
|
||||
if (theObject->HasPoint()) {
|
||||
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint());
|
||||
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
|
||||
thePnts.Append(aPoint);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
|
||||
aDSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), theFirstSA->OfShape(), StepData_LFalse);
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
|
||||
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
|
||||
aDefinition.SetValue(aDSA);
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItem = new StepRepr_HArray1OfRepresentationItem(1, 1);
|
||||
anItem->SetValue(1, aPoint);
|
||||
aGISU->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), aDefinition, theRepr, anItem);
|
||||
Handle(StepRepr_ShapeAspectDerivingRelationship) aSADR = new StepRepr_ShapeAspectDerivingRelationship();
|
||||
aSADR->Init(new TCollection_HAsciiString(), Standard_False, new TCollection_HAsciiString(), aDSA, theFirstSA);
|
||||
theFirstSA = aDSA;
|
||||
aModel->AddWithRefs(aGISU);
|
||||
aModel->AddWithRefs(aSADR);
|
||||
}
|
||||
|
||||
// Second point (for locations)
|
||||
if (theObject->HasPoint2()) {
|
||||
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2());
|
||||
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
|
||||
thePnts.Append(aPoint);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
|
||||
aDSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), theFirstSA->OfShape(), StepData_LFalse);
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
|
||||
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
|
||||
aDefinition.SetValue(aDSA);
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItem = new StepRepr_HArray1OfRepresentationItem(1, 1);
|
||||
anItem->SetValue(1, aPoint);
|
||||
aGISU->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), aDefinition, theRepr, anItem);
|
||||
Handle(StepRepr_ShapeAspectDerivingRelationship) aSADR = new StepRepr_ShapeAspectDerivingRelationship();
|
||||
aSADR->Init(new TCollection_HAsciiString(), Standard_False, new TCollection_HAsciiString(), aDSA, theSecondSA);
|
||||
theSecondSA = aDSA;
|
||||
aModel->AddWithRefs(aGISU);
|
||||
aModel->AddWithRefs(aSADR);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteDatumSystem
|
||||
//purpose : auxiliary (write Write datum system for given
|
||||
@@ -3611,6 +3668,14 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
//------------------//
|
||||
aDGTLabels.Clear();
|
||||
DGTTool->GetDimensionLabels(aDGTLabels);
|
||||
// Auxiliary entities for derived geometry
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentation) aCGRepr =
|
||||
new StepRepr_ConstructiveGeometryRepresentation();
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCGReprRel =
|
||||
new StepRepr_ConstructiveGeometryRepresentationRelationship();
|
||||
NCollection_Vector<Handle(StepGeom_CartesianPoint)> aConnectionPnts;
|
||||
Handle(StepRepr_RepresentationContext) dummyRC;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) dummyGISU;
|
||||
for (Standard_Integer i = 1; i <= aDGTLabels.Length(); i++) {
|
||||
TDF_Label aDimensionL = aDGTLabels.Value(i);
|
||||
TDF_LabelSequence aFirstShapeL, aSecondShapeL;
|
||||
@@ -3624,8 +3689,6 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
continue;
|
||||
|
||||
// Write links with shapes
|
||||
Handle(StepRepr_RepresentationContext) dummyRC;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) dummyGISU;
|
||||
Handle(StepRepr_ShapeAspect) aFirstSA, aSecondSA;
|
||||
if (aFirstShapeL.Length() == 1) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aFirstShapeL.Value(1));
|
||||
@@ -3679,6 +3742,8 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
|
||||
// Write dimensions
|
||||
StepShape_DimensionalCharacteristic aDimension;
|
||||
if (anObject->HasPoint() || anObject->HasPoint2())
|
||||
WriteDerivedGeometry(WS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts);
|
||||
XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
|
||||
if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) {
|
||||
// Dimensional_Location
|
||||
@@ -3746,6 +3811,15 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
//Annotation plane and Presentation
|
||||
WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
|
||||
}
|
||||
// Write Derived geometry
|
||||
if (aConnectionPnts.Length() > 0) {
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionPnts.Length());
|
||||
for (Standard_Integer i = 0; i < aConnectionPnts.Length(); i++)
|
||||
anItems->SetValue(i + 1, aConnectionPnts(i));
|
||||
aCGRepr->Init(new TCollection_HAsciiString(), anItems, dummyRC);
|
||||
aCGReprRel->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), dummyGISU->UsedRepresentation(), aCGRepr);
|
||||
aModel->AddWithRefs(aCGReprRel);
|
||||
}
|
||||
|
||||
//----------------------------//
|
||||
// write Geometric Tolerances //
|
||||
|
@@ -739,6 +739,8 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
|
||||
#include <StepVisual_TessellatedGeometricSet.hxx>
|
||||
#include <StepVisual_TessellatedCurveSet.hxx>
|
||||
#include <StepVisual_CoordinatesList.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
|
||||
static int init = 0;
|
||||
static Interface_DataMapOfTransientInteger types(800);
|
||||
@@ -1437,8 +1439,9 @@ StepAP214_Protocol::StepAP214_Protocol ()
|
||||
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);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_ConstructiveGeometryRepresentation), 712);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_ConstructiveGeometryRepresentationRelationship), 713);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -34,6 +34,10 @@ StepRepr_ConfigurationEffectivity.cxx
|
||||
StepRepr_ConfigurationEffectivity.hxx
|
||||
StepRepr_ConfigurationItem.cxx
|
||||
StepRepr_ConfigurationItem.hxx
|
||||
StepRepr_ConstructiveGeometryRepresentation.cxx
|
||||
StepRepr_ConstructiveGeometryRepresentation.hxx
|
||||
StepRepr_ConstructiveGeometryRepresentationRelationship.cxx
|
||||
StepRepr_ConstructiveGeometryRepresentationRelationship.hxx
|
||||
StepRepr_ContinuosShapeAspect.cxx
|
||||
StepRepr_ContinuosShapeAspect.hxx
|
||||
StepRepr_DataEnvironment.cxx
|
||||
|
22
src/StepRepr/StepRepr_ConstructiveGeometryRepresentation.cxx
Normal file
22
src/StepRepr/StepRepr_ConstructiveGeometryRepresentation.cxx
Normal file
@@ -0,0 +1,22 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 <Standard_Type.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ConstructiveGeometryRepresentation, StepRepr_Representation)
|
||||
|
||||
StepRepr_ConstructiveGeometryRepresentation::StepRepr_ConstructiveGeometryRepresentation () {}
|
39
src/StepRepr/StepRepr_ConstructiveGeometryRepresentation.hxx
Normal file
39
src/StepRepr/StepRepr_ConstructiveGeometryRepresentation.hxx
Normal file
@@ -0,0 +1,39 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 _StepRepr_ConstructiveGeometryRepresentation_HeaderFile
|
||||
#define _StepRepr_ConstructiveGeometryRepresentation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_Representation.hxx>
|
||||
|
||||
|
||||
class StepRepr_ConstructiveGeometryRepresentation;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_ConstructiveGeometryRepresentation, StepRepr_Representation)
|
||||
|
||||
|
||||
class StepRepr_ConstructiveGeometryRepresentation : public StepRepr_Representation
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns a ConstructiveGeometryRepresentation
|
||||
Standard_EXPORT StepRepr_ConstructiveGeometryRepresentation();
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepRepr_ConstructiveGeometryRepresentation,StepRepr_Representation)
|
||||
};
|
||||
|
||||
#endif // _StepRepr_ConstructiveGeometryRepresentation_HeaderFile
|
@@ -0,0 +1,22 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 <Standard_Type.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ConstructiveGeometryRepresentationRelationship, StepRepr_RepresentationRelationship)
|
||||
|
||||
StepRepr_ConstructiveGeometryRepresentationRelationship::StepRepr_ConstructiveGeometryRepresentationRelationship() { }
|
@@ -0,0 +1,36 @@
|
||||
// Created on: 2016-04-26
|
||||
// Created by: Irina KRYLOVA
|
||||
// Copyright (c) 2016 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 _StepRepr_ConstructiveGeometryRepresentationRelationship_HeaderFile
|
||||
#define _StepRepr_ConstructiveGeometryRepresentationRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_RepresentationRelationship.hxx>
|
||||
|
||||
class StepRepr_ConstructiveGeometryRepresentationRelationship;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_ConstructiveGeometryRepresentationRelationship, StepRepr_RepresentationRelationship)
|
||||
|
||||
class StepRepr_ConstructiveGeometryRepresentationRelationship : public StepRepr_RepresentationRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT StepRepr_ConstructiveGeometryRepresentationRelationship();
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepRepr_ConstructiveGeometryRepresentationRelationship, StepRepr_RepresentationRelationship)
|
||||
|
||||
};
|
||||
#endif // _StepRepr_ConstructiveGeometryRepresentationRelationship_HeaderFile
|
@@ -27,6 +27,8 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject()
|
||||
{
|
||||
myHasPlane = Standard_False;
|
||||
myHasPntText = Standard_False;
|
||||
myHasPoint1 = Standard_False;
|
||||
myHasPoint2 = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -47,7 +49,10 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handl
|
||||
myModifiers = theObj->myModifiers;
|
||||
myPath = theObj->myPath;
|
||||
myDir = theObj->myDir;
|
||||
myPnts = theObj->myPnts;
|
||||
myHasPoint1 = theObj->myHasPoint1;
|
||||
myPnt1 = theObj->myPnt1;
|
||||
myHasPoint2 = theObj->myHasPoint2;
|
||||
myPnt2 = theObj->myPnt2;
|
||||
myPntText= theObj->myPntText;
|
||||
myHasPlane = theObj->myHasPlane;
|
||||
myPlane = theObj->myPlane;
|
||||
@@ -425,24 +430,6 @@ Standard_Boolean XCAFDimTolObjects_DimensionObject::SetDirection (const gp_Dir&
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TColgp_HArray1OfPnt) XCAFDimTolObjects_DimensionObject::GetPoints () const
|
||||
{
|
||||
return myPnts;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void XCAFDimTolObjects_DimensionObject::SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts)
|
||||
{
|
||||
myPnts = thePnts;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RemoveDescription
|
||||
//purpose :
|
||||
|
@@ -117,8 +117,6 @@ public:
|
||||
Standard_EXPORT Standard_Boolean SetDirection (const gp_Dir& theDir);
|
||||
|
||||
Standard_EXPORT Handle(TColgp_HArray1OfPnt) GetPoints() const;
|
||||
|
||||
Standard_EXPORT void SetPoints (const Handle(TColgp_HArray1OfPnt)& thePnts);
|
||||
|
||||
Standard_EXPORT void SetPointTextAttach (const gp_Pnt& thePntText)
|
||||
{
|
||||
@@ -143,7 +141,36 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPlane() const { return myHasPlane; }
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasPoints() const { return (!myPnts.IsNull() && myPnts->Length() > 0); }
|
||||
//! Returns true, if connection point exists (for dimesional_size),
|
||||
//! if connection point for first shape exists (for dimensional_location)
|
||||
Standard_EXPORT Standard_Boolean HasPoint() const { return myHasPoint1; }
|
||||
|
||||
// Returns true, if connection point for second shape exists (for dimensional_location only)
|
||||
Standard_EXPORT Standard_Boolean HasPoint2() const { return myHasPoint2; }
|
||||
|
||||
//! Set connection point (for dimesional_size),
|
||||
//! Set connection point for first shape (for dimensional_location)
|
||||
Standard_EXPORT void SetPoint(const gp_Pnt thePnt) {
|
||||
myPnt1 = thePnt;
|
||||
myHasPoint1 = Standard_True;
|
||||
}
|
||||
|
||||
// Set connection point for second shape(for dimensional_location only)
|
||||
Standard_EXPORT void SetPoint2(const gp_Pnt thePnt) {
|
||||
myPnt2 = thePnt;
|
||||
myHasPoint2 = Standard_True;
|
||||
}
|
||||
|
||||
//! Get connection point (for dimesional_size),
|
||||
//! Get connection point for first shape (for dimensional_location)
|
||||
Standard_EXPORT gp_Pnt GetPoint() const {
|
||||
return myPnt1;
|
||||
}
|
||||
|
||||
// Get connection point for second shape(for dimensional_location only)
|
||||
Standard_EXPORT gp_Pnt GetPoint2() const {
|
||||
return myPnt2;
|
||||
}
|
||||
|
||||
//! Set graphical presentation for object
|
||||
Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation,
|
||||
@@ -218,7 +245,8 @@ private:
|
||||
XCAFDimTolObjects_DimensionModifiersSequence myModifiers;
|
||||
TopoDS_Edge myPath;
|
||||
gp_Dir myDir;
|
||||
Handle(TColgp_HArray1OfPnt) myPnts;
|
||||
gp_Pnt myPnt1, myPnt2;
|
||||
Standard_Boolean myHasPoint1, myHasPoint2;
|
||||
gp_Ax2 myPlane;
|
||||
Standard_Boolean myHasPlane;
|
||||
Standard_Boolean myHasPntText;
|
||||
|
@@ -44,7 +44,8 @@ enum ChildLab
|
||||
ChildLab_Modifiers,
|
||||
ChildLab_Path,
|
||||
ChildLab_Dir,
|
||||
ChildLab_Pnts,
|
||||
ChildLab_Pnt1,
|
||||
ChildLab_Pnt2,
|
||||
ChildLab_PlaneLoc,
|
||||
ChildLab_PlaneN,
|
||||
ChildLab_PlaneRef,
|
||||
@@ -178,22 +179,30 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
|
||||
aDir->ChangeArray(anArrR);
|
||||
}
|
||||
|
||||
Handle(TColgp_HArray1OfPnt) aP = theObject->GetPoints();
|
||||
if(!aP.IsNull() && aP->Length() > 0)
|
||||
if (theObject->HasPoint())
|
||||
{
|
||||
anArrR = new TColStd_HArray1OfReal(1,aP->Length() * 3);
|
||||
Handle(TDataStd_RealArray) aPnts;
|
||||
anArrR->SetValue(1,aP->Value(1).X());
|
||||
anArrR->SetValue(2,aP->Value(1).Y());
|
||||
anArrR->SetValue(3,aP->Value(1).Z());
|
||||
if (aP->Length() == 2) {
|
||||
anArrR->SetValue(4,aP->Value(2).X());
|
||||
anArrR->SetValue(5,aP->Value(2).Y());
|
||||
anArrR->SetValue(6,aP->Value(2).Z());
|
||||
}
|
||||
aPnts = new TDataStd_RealArray();
|
||||
Label().FindChild(ChildLab_Pnts).AddAttribute(aPnts);
|
||||
aPnts->ChangeArray(anArrR);
|
||||
Handle(TDataStd_RealArray) aPnt = new TDataStd_RealArray();
|
||||
gp_Pnt aPnt1 = theObject->GetPoint();
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aPntArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aPntArr->SetValue(i, aPnt1.Coord(i));
|
||||
aPnt->ChangeArray(aPntArr);
|
||||
|
||||
Label().FindChild(ChildLab_Pnt1).AddAttribute(aPnt);
|
||||
}
|
||||
|
||||
if (theObject->HasPoint2())
|
||||
{
|
||||
Handle(TDataStd_RealArray) aPnt = new TDataStd_RealArray();
|
||||
gp_Pnt aPnt2 = theObject->GetPoint2();
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aPntArr = new TColStd_HArray1OfReal(1, 3);
|
||||
for (Standard_Integer i = 1; i <= 3; i++)
|
||||
aPntArr->SetValue(i, aPnt2.Coord(i));
|
||||
aPnt->ChangeArray(aPntArr);
|
||||
|
||||
Label().FindChild(ChildLab_Pnt2).AddAttribute(aPnt);
|
||||
}
|
||||
|
||||
if (theObject->HasPlane())
|
||||
@@ -336,19 +345,18 @@ Handle(XCAFDimTolObjects_DimensionObject) XCAFDoc_Dimension::GetObject() const
|
||||
anObj->SetDirection(aD);
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aPnts;
|
||||
if(Label().FindChild(ChildLab_Pnts).FindAttribute(TDataStd_RealArray::GetID(), aPnts)
|
||||
&& !aPnts->Array().IsNull() && aPnts->Array()->Length() > 2)
|
||||
Handle(TDataStd_RealArray) aPnt1;
|
||||
if(Label().FindChild(ChildLab_Pnt1).FindAttribute(TDataStd_RealArray::GetID(), aPnt1) && aPnt1->Length() == 3 )
|
||||
{
|
||||
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)
|
||||
{
|
||||
gp_Pnt aP2(aPnts->Array()->Value(4), aPnts->Array()->Value(5), aPnts->Array()->Value(6));
|
||||
aP->SetValue(2, aP2);
|
||||
}
|
||||
anObj->SetPoints(aP);
|
||||
gp_Pnt aP(aPnt1->Value(aPnt1->Lower()), aPnt1->Value(aPnt1->Lower()+1), aPnt1->Value(aPnt1->Lower()+2));
|
||||
anObj->SetPoint(aP);
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aPnt2;
|
||||
if(Label().FindChild(ChildLab_Pnt2).FindAttribute(TDataStd_RealArray::GetID(), aPnt2) && aPnt2->Length() == 3 )
|
||||
{
|
||||
gp_Pnt aP(aPnt2->Value(aPnt2->Lower()), aPnt2->Value(aPnt2->Lower()+1), aPnt2->Value(aPnt2->Lower()+2));
|
||||
anObj->SetPoint2(aP);
|
||||
}
|
||||
|
||||
Handle(TDataStd_RealArray) aLoc, aN, aR;
|
||||
|
@@ -2018,8 +2018,8 @@ static Standard_Integer addDimPath (Draw_Interpretor& di, Standard_Integer argc,
|
||||
|
||||
static Standard_Integer addDimPoints (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 5) {
|
||||
di<<"Use: XSetDimensionPoints Doc Dim_Label v1 v2\n";
|
||||
if (argc < 4) {
|
||||
di<<"Use: XSetDimensionPoints Doc Dim_Label v1 [v2]\n";
|
||||
return 1;
|
||||
}
|
||||
Handle(TDocStd_Document) Doc;
|
||||
@@ -2038,17 +2038,19 @@ static Standard_Integer addDimPoints (Draw_Interpretor& di, Standard_Integer arg
|
||||
Handle(XCAFDoc_Dimension) aDimension;
|
||||
if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
|
||||
{
|
||||
Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
|
||||
|
||||
TopoDS_Vertex aV1 = TopoDS::Vertex(DBRep::Get(argv[3],TopAbs_VERTEX));
|
||||
TopoDS_Vertex aV2 = TopoDS::Vertex(DBRep::Get(argv[4],TopAbs_VERTEX));
|
||||
if(!aV1.IsNull() && !aV1.IsNull())
|
||||
{
|
||||
Handle(TColgp_HArray1OfPnt) arr = new TColgp_HArray1OfPnt(1,2);
|
||||
arr->SetValue(1, BRep_Tool::Pnt(aV1));
|
||||
arr->SetValue(2, BRep_Tool::Pnt(aV2));
|
||||
Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
|
||||
anObj->SetPoints(arr);
|
||||
aDimension->SetObject(anObj);
|
||||
if(!aV1.IsNull()) {
|
||||
anObj->SetPoint(BRep_Tool::Pnt(aV1));
|
||||
}
|
||||
if (argc == 5) {
|
||||
TopoDS_Vertex aV2 = TopoDS::Vertex(DBRep::Get(argv[4],TopAbs_VERTEX));
|
||||
if(!aV2.IsNull()) {
|
||||
anObj->SetPoint2(BRep_Tool::Pnt(aV2));
|
||||
}
|
||||
}
|
||||
aDimension->SetObject(anObj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -2075,11 +2077,12 @@ static Standard_Integer getDimPoints (Draw_Interpretor& di, Standard_Integer arg
|
||||
Handle(XCAFDoc_Dimension) aDimension;
|
||||
if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
|
||||
{
|
||||
Handle(TColgp_HArray1OfPnt) pnts = aDimension->GetObject()->GetPoints();
|
||||
if(!pnts.IsNull() && pnts->Length() == 2)
|
||||
{
|
||||
di << pnts->Value(1).X() << ";" << pnts->Value(1).Y() << ";" << pnts->Value(1).Z() << " ";
|
||||
di << pnts->Value(2).X() << ";" << pnts->Value(2).Y() << ";" << pnts->Value(2).Z();
|
||||
Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
|
||||
if(anObj->HasPoint()) {
|
||||
di << anObj->GetPoint().X() << ";" << anObj->GetPoint().Y() << ";" << anObj->GetPoint().Z() << " ";
|
||||
}
|
||||
if(anObj->HasPoint2()) {
|
||||
di << anObj->GetPoint2().X() << ";" << anObj->GetPoint2().Y() << ";" << anObj->GetPoint2().Z();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -2732,7 +2735,7 @@ void XDEDRAW_GDTs::InitCommands(Draw_Interpretor& di)
|
||||
di.Add ("XSetDimensionPath","XSetDimensionPath Doc Dim_Label path(edge)",
|
||||
__FILE__, addDimPath, g);
|
||||
|
||||
di.Add ("XSetDimensionPoints","XSetDimensionPoints Doc Dim_Label v1 v2",
|
||||
di.Add ("XSetDimensionPoints","XSetDimensionPoints Doc Dim_Label v1 [v2]",
|
||||
__FILE__, addDimPoints, g);
|
||||
|
||||
di.Add ("XGetDimensionPoints","XGetDimensionPoints Doc Dim_Label",
|
||||
|
Reference in New Issue
Block a user