mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -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
|
Reference in New Issue
Block a user