1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0028389: Data Exchange - Import of STEP Saved Views and Clipping Planes

- new STEP entities for Saved Views
- import of STEP Saved Views
- new XCAF tool for clipping planes
- new draw commands
- update test
This commit is contained in:
ika
2017-01-25 14:13:45 +03:00
committed by apn
parent cfece3ef2e
commit 0c63f2f8b9
73 changed files with 3191 additions and 79 deletions

View File

@@ -20,6 +20,12 @@ RWStepVisual_RWCameraModelD2.cxx
RWStepVisual_RWCameraModelD2.hxx
RWStepVisual_RWCameraModelD3.cxx
RWStepVisual_RWCameraModelD3.hxx
RWStepVisual_RWCameraModelD3MultiClipping.cxx
RWStepVisual_RWCameraModelD3MultiClipping.hxx
RWStepVisual_RWCameraModelD3MultiClippingIntersection.cxx
RWStepVisual_RWCameraModelD3MultiClippingIntersection.hxx
RWStepVisual_RWCameraModelD3MultiClippingUnion.cxx
RWStepVisual_RWCameraModelD3MultiClippingUnion.hxx
RWStepVisual_RWCameraUsage.cxx
RWStepVisual_RWCameraUsage.hxx
RWStepVisual_RWCharacterizedObjectAndCharacterizedRepresentationAndDraughtingModelAndRepresentation.cxx

View File

@@ -0,0 +1,118 @@
// Created on: 2016-10-25
// 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 <RWStepVisual_RWCameraModelD3MultiClipping.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepVisual_CameraModelD3MultiClipping.hxx>
#include <StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect.hxx>
#include <StepVisual_ViewVolume.hxx>
//=======================================================================
//function : RWStepVisual_RWCameraModelD3MultiClipping
//purpose :
//=======================================================================
RWStepVisual_RWCameraModelD3MultiClipping::RWStepVisual_RWCameraModelD3MultiClipping() {}
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClipping::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_CameraModelD3MultiClipping)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num, 4, ach, "camera_model_d3_multi_clipping"))
return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
//Inherited field : view_reference_system
Handle(StepGeom_Axis2Placement3d) aViewReferenceSystem;
data->ReadEntity(num, 2, "view_reference_system", ach, STANDARD_TYPE(StepGeom_Axis2Placement3d), aViewReferenceSystem);
// Inherited field : perspective_of_volume
Handle(StepVisual_ViewVolume) aPerspectiveOfVolume;
data->ReadEntity(num, 3, "perspective_of_volume", ach, STANDARD_TYPE(StepVisual_ViewVolume), aPerspectiveOfVolume);
// Own field : shape_clipping
Handle(StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect) aShapeClipping;
StepVisual_CameraModelD3MultiClippingInterectionSelect anEnt;
Standard_Integer nbSub;
if (data->ReadSubList(num, 4, "shape_clipping", ach, nbSub)) {
Standard_Integer nbElements = data->NbParams(nbSub);
aShapeClipping = new StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect(1, nbElements);
for (Standard_Integer i = 1; i <= nbElements; i++) {
if (data->ReadEntity(nbSub, i, "shape_clipping", ach, anEnt))
aShapeClipping->SetValue(i, anEnt);
}
}
// Initialization of the read entity
ent->Init(aName, aViewReferenceSystem, aPerspectiveOfVolume, aShapeClipping);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClipping::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_CameraModelD3MultiClipping)& ent) const
{
// Inherited field name
SW.Send(ent->Name());
// Inherited field view_reference_system
SW.Send(ent->ViewReferenceSystem());
// Inherited field view_reference_system
SW.Send(ent->PerspectiveOfVolume());
// Own field: shape_clipping
SW.OpenSub();
for (Standard_Integer i = 1; i <= ent->ShapeClipping()->Length(); i++) {
SW.Send(ent->ShapeClipping()->Value(i).Value());
}
SW.CloseSub();
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClipping::Share
(const Handle(StepVisual_CameraModelD3MultiClipping)& ent,
Interface_EntityIterator& iter) const
{
// Inherited field view_reference_system
iter.GetOneItem(ent->ViewReferenceSystem());
// Inherited field : perspective_of_volume
iter.GetOneItem(ent->PerspectiveOfVolume());
// Own field: shape_clipping
Standard_Integer i, nb = ent->ShapeClipping()->Length();
for (i = 1; i <= nb; i++)
iter.AddItem(ent->ShapeClipping()->Value(i).Value());
}

View File

@@ -0,0 +1,48 @@
// Created on: 2016-10-25
// 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 _RWStepVisual_RWCameraModelD3MultiClipping_HeaderFile
#define _RWStepVisual_RWCameraModelD3MultiClipping_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_CameraModelD3MultiClipping;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for CameraModelD3MultiClipping
class RWStepVisual_RWCameraModelD3MultiClipping
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWCameraModelD3MultiClipping();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_CameraModelD3MultiClipping)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_CameraModelD3MultiClipping)& ent) const;
Standard_EXPORT void Share(const Handle(StepVisual_CameraModelD3MultiClipping)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWCameraModelD3MultiClipping_HeaderFile

View File

@@ -0,0 +1,98 @@
// Created on: 2016-11-14
// 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 <RWStepVisual_RWCameraModelD3MultiClippingIntersection.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepVisual_CameraModelD3MultiClippingIntersection.hxx>
#include <StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect.hxx>
//=======================================================================
//function : RWStepVisual_RWCameraModelD3MultiClippingIntersection
//purpose :
//=======================================================================
RWStepVisual_RWCameraModelD3MultiClippingIntersection::RWStepVisual_RWCameraModelD3MultiClippingIntersection() {}
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClippingIntersection::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_CameraModelD3MultiClippingIntersection)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num, 2, ach, "camera_model_d3_multi_clipping_intersection"))
return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
// Own field : shape_clipping
Handle(StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect) aShapeClipping;
StepVisual_CameraModelD3MultiClippingInterectionSelect anEnt;
Standard_Integer nbSub;
if (data->ReadSubList(num, 2, "shape_clipping", ach, nbSub)) {
Standard_Integer nbElements = data->NbParams(nbSub);
aShapeClipping = new StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect(1, nbElements);
for (Standard_Integer i = 1; i <= nbElements; i++) {
if (data->ReadEntity(nbSub, i, "shape_clipping", ach, anEnt))
aShapeClipping->SetValue(i, anEnt);
}
}
// Initialization of the read entity
ent->Init(aName, aShapeClipping);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClippingIntersection::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_CameraModelD3MultiClippingIntersection)& ent) const
{
// Inherited field name
SW.Send(ent->Name());
// Own field: shape_clipping
SW.OpenSub();
for (Standard_Integer i = 1; i <= ent->ShapeClipping()->Length(); i++) {
SW.Send(ent->ShapeClipping()->Value(i).Value());
}
SW.CloseSub();
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClippingIntersection::Share
(const Handle(StepVisual_CameraModelD3MultiClippingIntersection)& ent,
Interface_EntityIterator& iter) const
{
// Own field: shape_clipping
Standard_Integer i, nb = ent->ShapeClipping()->Length();
for (i = 1; i <= nb; i++)
iter.AddItem(ent->ShapeClipping()->Value(i).Value());
}

View File

@@ -0,0 +1,48 @@
// Created on: 2016-11-14
// 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 _RWStepVisual_RWCameraModelD3MultiClippingIntersection_HeaderFile
#define _RWStepVisual_RWCameraModelD3MultiClippingIntersection_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_CameraModelD3MultiClippingIntersection;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for CameraModelD3MultiClippingIntersection
class RWStepVisual_RWCameraModelD3MultiClippingIntersection
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWCameraModelD3MultiClippingIntersection();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_CameraModelD3MultiClippingIntersection)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_CameraModelD3MultiClippingIntersection)& ent) const;
Standard_EXPORT void Share(const Handle(StepVisual_CameraModelD3MultiClippingIntersection)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWCameraModelD3MultiClippingIntersection_HeaderFile

View File

@@ -0,0 +1,98 @@
// Created on: 2016-11-14
// 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 <RWStepVisual_RWCameraModelD3MultiClippingUnion.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepVisual_CameraModelD3MultiClippingUnion.hxx>
#include <StepVisual_HArray1OfCameraModelD3MultiClippingUnionSelect.hxx>
//=======================================================================
//function : RWStepVisual_RWCameraModelD3MultiClippingUnion
//purpose :
//=======================================================================
RWStepVisual_RWCameraModelD3MultiClippingUnion::RWStepVisual_RWCameraModelD3MultiClippingUnion() {}
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClippingUnion::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_CameraModelD3MultiClippingUnion)& ent) const
{
// Number of Parameter Control
if (!data->CheckNbParams(num, 2, ach, "camera_model_d3_multi_clipping_union"))
return;
// Inherited field : name
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
// Own field : shape_clipping
Handle(StepVisual_HArray1OfCameraModelD3MultiClippingUnionSelect) aShapeClipping;
StepVisual_CameraModelD3MultiClippingUnionSelect anEnt;
Standard_Integer nbSub;
if (data->ReadSubList(num, 2, "shape_clipping", ach, nbSub)) {
Standard_Integer nbElements = data->NbParams(nbSub);
aShapeClipping = new StepVisual_HArray1OfCameraModelD3MultiClippingUnionSelect(1, nbElements);
for (Standard_Integer i = 1; i <= nbElements; i++) {
if (data->ReadEntity(nbSub, i, "shape_clipping", ach, anEnt))
aShapeClipping->SetValue(i, anEnt);
}
}
// Initialization of the read entity
ent->Init(aName, aShapeClipping);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClippingUnion::WriteStep
(StepData_StepWriter& SW,
const Handle(StepVisual_CameraModelD3MultiClippingUnion)& ent) const
{
// Inherited field name
SW.Send(ent->Name());
// Own field: shape_clipping
SW.OpenSub();
for (Standard_Integer i = 1; i <= ent->ShapeClipping()->Length(); i++) {
SW.Send(ent->ShapeClipping()->Value(i).Value());
}
SW.CloseSub();
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWCameraModelD3MultiClippingUnion::Share
(const Handle(StepVisual_CameraModelD3MultiClippingUnion)& ent,
Interface_EntityIterator& iter) const
{
// Own field: shape_clipping
Standard_Integer i, nb = ent->ShapeClipping()->Length();
for (i = 1; i <= nb; i++)
iter.AddItem(ent->ShapeClipping()->Value(i).Value());
}

View File

@@ -0,0 +1,48 @@
// Created on: 2016-11-14
// 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 _RWStepVisual_RWCameraModelD3MultiClippingUnion_HeaderFile
#define _RWStepVisual_RWCameraModelD3MultiClippingUnion_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_CameraModelD3MultiClippingUnion;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write Module for CameraModelD3MultiClippingUnion
class RWStepVisual_RWCameraModelD3MultiClippingUnion
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT RWStepVisual_RWCameraModelD3MultiClippingUnion();
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepVisual_CameraModelD3MultiClippingUnion)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_CameraModelD3MultiClippingUnion)& ent) const;
Standard_EXPORT void Share(const Handle(StepVisual_CameraModelD3MultiClippingUnion)& ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWCameraModelD3MultiClippingUnion_HeaderFile