mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,2 +1,27 @@
|
||||
TDataXtd.cxx
|
||||
TDataXtd.hxx
|
||||
TDataXtd_Array1OfTrsf.hxx
|
||||
TDataXtd_Axis.cxx
|
||||
TDataXtd_Axis.hxx
|
||||
TDataXtd_Constraint.cxx
|
||||
TDataXtd_Constraint.hxx
|
||||
TDataXtd_ConstraintEnum.hxx
|
||||
TDataXtd_Geometry.cxx
|
||||
TDataXtd_Geometry.hxx
|
||||
TDataXtd_GeometryEnum.hxx
|
||||
TDataXtd_HArray1OfTrsf.hxx
|
||||
TDataXtd_Pattern.cxx
|
||||
TDataXtd_Pattern.hxx
|
||||
TDataXtd_PatternStd.cxx
|
||||
TDataXtd_PatternStd.hxx
|
||||
TDataXtd_PatternStd.lxx
|
||||
TDataXtd_Placement.cxx
|
||||
TDataXtd_Placement.hxx
|
||||
TDataXtd_Plane.cxx
|
||||
TDataXtd_Plane.hxx
|
||||
TDataXtd_Point.cxx
|
||||
TDataXtd_Point.hxx
|
||||
TDataXtd_Position.cxx
|
||||
TDataXtd_Position.hxx
|
||||
TDataXtd_Shape.cxx
|
||||
TDataXtd_Shape.hxx
|
||||
|
@@ -1,142 +0,0 @@
|
||||
-- Created on: 2008-05-29
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2008-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package TDataXtd
|
||||
|
||||
---Purpose: This package defines extension of standard attributes for
|
||||
-- modelling (mainly for work with geometry).
|
||||
|
||||
--- Category: GUID - AttributeID
|
||||
|
||||
-- 2a96b602-ec8b-11d0-bee7-080009dc3333 TDataXtd_Constraint
|
||||
-- 2a96b618-ec8b-11d0-bee7-080009dc3333 TDataXtd_Pattern
|
||||
-- 2a96b61b-ec8b-11d0-bee7-080009dc3333 TDataXtd_PatternStd
|
||||
-- 2a96b620-ec8b-11d0-bee7-080009dc3333 TDataXtd_Shape
|
||||
-- 2a96b60d-ec8b-11d0-bee7-080009dc3333 TDataXtd_Point
|
||||
-- 2a96b601-ec8b-11d0-bee7-080009dc3333 TDataXtd_Axis
|
||||
-- 2a96b60c-ec8b-11d0-bee7-080009dc3333 TDataXtd_Plane
|
||||
-- 2a96b604-ec8b-11d0-bee7-080009dc3333 TDataXtd_Geometry
|
||||
-- 2a96b60b-ec8b-11d0-bee7-080009dc3333 TDataXtd_Placement
|
||||
uses Standard,
|
||||
TCollection,
|
||||
TColStd,
|
||||
gp,
|
||||
BRep,
|
||||
Geom,
|
||||
TopoDS,
|
||||
TDF,
|
||||
TDataStd,
|
||||
TNaming
|
||||
|
||||
is
|
||||
enumeration ConstraintEnum is
|
||||
--- Purpose: The terms of this enumeration define the types
|
||||
-- of available constraint.
|
||||
-- ==================
|
||||
RADIUS,
|
||||
DIAMETER,
|
||||
MINOR_RADIUS,
|
||||
MAJOR_RADIUS,
|
||||
TANGENT,
|
||||
PARALLEL,
|
||||
PERPENDICULAR,
|
||||
CONCENTRIC,
|
||||
COINCIDENT,
|
||||
DISTANCE,
|
||||
ANGLE,
|
||||
EQUAL_RADIUS,
|
||||
SYMMETRY,
|
||||
MIDPOINT,
|
||||
EQUAL_DISTANCE,
|
||||
FIX,
|
||||
RIGID,
|
||||
|
||||
-- placement constraints
|
||||
-- =====================
|
||||
FROM,
|
||||
AXIS,
|
||||
MATE,
|
||||
ALIGN_FACES,
|
||||
ALIGN_AXES,
|
||||
AXES_ANGLE,
|
||||
FACES_ANGLE,
|
||||
ROUND,
|
||||
OFFSET
|
||||
end ConstraintEnum;
|
||||
|
||||
enumeration GeometryEnum is
|
||||
---Purpose:
|
||||
-- The terms of this enumeration define the types of geometric shapes available.
|
||||
ANY_GEOM,
|
||||
POINT,
|
||||
LINE,
|
||||
CIRCLE,
|
||||
ELLIPSE,
|
||||
SPLINE,
|
||||
PLANE,
|
||||
CYLINDER
|
||||
end GeometryEnum;
|
||||
|
||||
---Category: Basic attributes for geometry
|
||||
-- =============================
|
||||
|
||||
class Position;
|
||||
|
||||
class Constraint;
|
||||
|
||||
class Placement;
|
||||
|
||||
class Geometry;
|
||||
|
||||
class Point;
|
||||
|
||||
class Axis;
|
||||
|
||||
class Plane;
|
||||
|
||||
deferred class Pattern;
|
||||
|
||||
class PatternStd;
|
||||
|
||||
class Shape;
|
||||
|
||||
---Category: tools
|
||||
-- =====
|
||||
|
||||
imported Array1OfTrsf;
|
||||
|
||||
imported transient class HArray1OfTrsf;
|
||||
|
||||
IDList (anIDList : in out IDList from TDF);
|
||||
---Purpose: Appends to <anIDList> the list of the attributes
|
||||
-- IDs of this package. CAUTION: <anIDList> is NOT
|
||||
-- cleared before use.
|
||||
|
||||
---Purpose: Print of TDataExt enumeration
|
||||
-- =============================
|
||||
|
||||
Print (GEO : GeometryEnum from TDataXtd; S : in out OStream)
|
||||
---Purpose: Prints the name of the geometry dimension <GEO> as a String on
|
||||
-- the Stream <S> and returns <S>.
|
||||
---C++: return &
|
||||
returns OStream;
|
||||
|
||||
Print (CTR : ConstraintEnum from TDataXtd; S : in out OStream)
|
||||
---Purpose: Prints the name of the constraint <CTR> as a String on
|
||||
-- the Stream <S> and returns <S>.
|
||||
---C++: return &
|
||||
returns OStream;
|
||||
|
||||
end TDataXtd;
|
@@ -13,15 +13,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd.ixx>
|
||||
#include <TDataXtd.ixx>
|
||||
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDataXtd_Axis.hxx>
|
||||
#include <TDataXtd_Constraint.hxx>
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
#include <TDataXtd_PatternStd.hxx>
|
||||
#include <TDataXtd_Placement.hxx>
|
||||
#include <TDataXtd_Point.hxx>
|
||||
#include <TDataXtd_Plane.hxx>
|
||||
#include <TDataXtd_Point.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
#include <TDataXtd_Shape.hxx>
|
||||
#include <TDF_IDList.hxx>
|
||||
@@ -30,7 +30,6 @@
|
||||
//function : IDList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TDataXtd::IDList(TDF_IDList& anIDList)
|
||||
{
|
||||
anIDList.Append(TDataXtd_Axis::GetID());
|
||||
|
96
src/TDataXtd/TDataXtd.hxx
Normal file
96
src/TDataXtd/TDataXtd.hxx
Normal file
@@ -0,0 +1,96 @@
|
||||
// Created on: 2008-05-29
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2008-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_HeaderFile
|
||||
#define _TDataXtd_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TDF_IDList.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <TDataXtd_GeometryEnum.hxx>
|
||||
#include <TDataXtd_ConstraintEnum.hxx>
|
||||
class TDataXtd_Position;
|
||||
class TDataXtd_Constraint;
|
||||
class TDataXtd_Placement;
|
||||
class TDataXtd_Geometry;
|
||||
class TDataXtd_Point;
|
||||
class TDataXtd_Axis;
|
||||
class TDataXtd_Plane;
|
||||
class TDataXtd_Pattern;
|
||||
class TDataXtd_PatternStd;
|
||||
class TDataXtd_Shape;
|
||||
|
||||
|
||||
//! This package defines extension of standard attributes for
|
||||
//! modelling (mainly for work with geometry).
|
||||
class TDataXtd
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Appends to <anIDList> the list of the attributes
|
||||
//! IDs of this package. CAUTION: <anIDList> is NOT
|
||||
//! cleared before use.
|
||||
//! Print of TDataExt enumeration
|
||||
//! =============================
|
||||
Standard_EXPORT static void IDList (TDF_IDList& anIDList);
|
||||
|
||||
//! Prints the name of the geometry dimension <GEO> as a String on
|
||||
//! the Stream <S> and returns <S>.
|
||||
Standard_EXPORT static Standard_OStream& Print (const TDataXtd_GeometryEnum GEO, Standard_OStream& S);
|
||||
|
||||
//! Prints the name of the constraint <CTR> as a String on
|
||||
//! the Stream <S> and returns <S>.
|
||||
Standard_EXPORT static Standard_OStream& Print (const TDataXtd_ConstraintEnum CTR, Standard_OStream& S);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class TDataXtd_Position;
|
||||
friend class TDataXtd_Constraint;
|
||||
friend class TDataXtd_Placement;
|
||||
friend class TDataXtd_Geometry;
|
||||
friend class TDataXtd_Point;
|
||||
friend class TDataXtd_Axis;
|
||||
friend class TDataXtd_Plane;
|
||||
friend class TDataXtd_Pattern;
|
||||
friend class TDataXtd_PatternStd;
|
||||
friend class TDataXtd_Shape;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_HeaderFile
|
@@ -1,90 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Axis from TDataXtd inherits Attribute from TDF
|
||||
|
||||
|
||||
---Purpose: The basis to define an axis attribute.
|
||||
--
|
||||
-- Warning: Use TDataXtd_Geometry attribute to retrieve the
|
||||
-- gp_Lin of the Axis attribute
|
||||
|
||||
uses Attribute from TDF,
|
||||
Label from TDF,
|
||||
GUID from Standard,
|
||||
Line from Geom,
|
||||
Lin from gp,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF
|
||||
|
||||
|
||||
|
||||
|
||||
is
|
||||
|
||||
---Purpose: class methods
|
||||
-- =============
|
||||
|
||||
GetID(myclass)
|
||||
---C++: return const &
|
||||
---Purpose: Returns the GUID for an axis.
|
||||
returns GUID from Standard;
|
||||
|
||||
|
||||
Set (myclass ; label : Label from TDF)
|
||||
---Purpose: Finds or creates an axis attribute defined by the label.
|
||||
-- In the case of a creation of an axis, a compatible
|
||||
-- named shape should already be associated with label.
|
||||
-- Exceptions
|
||||
-- Standard_NullObject if no compatible named
|
||||
-- shape is associated with the label.
|
||||
returns Axis from TDataXtd;
|
||||
|
||||
Set (myclass ; label : Label from TDF; L : Lin from gp)
|
||||
---Purpose: Find, or create, an Axis attribute and set <P> as
|
||||
-- generated in the associated NamedShape.
|
||||
returns Axis from TDataXtd;
|
||||
|
||||
|
||||
---Purpose: Axis methods
|
||||
-- ============
|
||||
|
||||
Create
|
||||
returns Axis from TDataXtd;
|
||||
|
||||
---Category: TDF_Attribute methods
|
||||
-- =====================
|
||||
|
||||
ID(me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore(me: mutable; with : Attribute from TDF);
|
||||
|
||||
NewEmpty(me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
end Axis;
|
||||
|
||||
|
||||
|
@@ -12,32 +12,35 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Axis.ixx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDataXtd_Axis.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Axis::GetID ()
|
||||
{
|
||||
static Standard_GUID TDataXtd_AxisID("2a96b601-ec8b-11d0-bee7-080009dc3333");
|
||||
|
98
src/TDataXtd/TDataXtd_Axis.hxx
Normal file
98
src/TDataXtd/TDataXtd_Axis.hxx
Normal file
@@ -0,0 +1,98 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Axis_HeaderFile
|
||||
#define _TDataXtd_Axis_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class gp_Lin;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
class TDataXtd_Axis;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Axis, TDF_Attribute)
|
||||
|
||||
//! The basis to define an axis attribute.
|
||||
//!
|
||||
//! Warning: Use TDataXtd_Geometry attribute to retrieve the
|
||||
//! gp_Lin of the Axis attribute
|
||||
class TDataXtd_Axis : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! class methods
|
||||
//! =============
|
||||
//! Returns the GUID for an axis.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Finds or creates an axis attribute defined by the label.
|
||||
//! In the case of a creation of an axis, a compatible
|
||||
//! named shape should already be associated with label.
|
||||
//! Exceptions
|
||||
//! Standard_NullObject if no compatible named
|
||||
//! shape is associated with the label.
|
||||
Standard_EXPORT static Handle(TDataXtd_Axis) Set (const TDF_Label& label);
|
||||
|
||||
//! Find, or create, an Axis attribute and set <P> as
|
||||
//! generated in the associated NamedShape.
|
||||
//! Axis methods
|
||||
//! ============
|
||||
Standard_EXPORT static Handle(TDataXtd_Axis) Set (const TDF_Label& label, const gp_Lin& L);
|
||||
|
||||
Standard_EXPORT TDataXtd_Axis();
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Axis,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Axis_HeaderFile
|
@@ -1,246 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Constraint from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose: The groundwork to define constraint attributes.
|
||||
-- The constraint attribute contains the following sorts of data:
|
||||
-- - Type whether the constraint attribute is a
|
||||
-- geometric constraint or a dimension
|
||||
-- - Value the real number value of a numeric
|
||||
-- constraint such as an angle or a radius
|
||||
-- - Geometries to identify the geometries
|
||||
-- underlying the topological attributes which
|
||||
-- define the constraint (up to 4)
|
||||
-- - Plane for 2D constraints.
|
||||
|
||||
|
||||
|
||||
uses ConstraintEnum from TDataXtd,
|
||||
Attribute from TDF,
|
||||
Label from TDF,
|
||||
LabelList from TDF,
|
||||
LabelMap from TDF,
|
||||
GUID from Standard,
|
||||
Integer from Standard,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF,
|
||||
NamedShape from TNaming,
|
||||
Constraint from TDataXtd,
|
||||
Real from TDataStd
|
||||
|
||||
is
|
||||
|
||||
|
||||
GetID (myclass)
|
||||
---C++: return const &
|
||||
---Purpose: Returns the GUID for constraints.
|
||||
returns GUID from Standard;
|
||||
|
||||
|
||||
Set (myclass; label : Label from TDF)
|
||||
---Purpose: Finds or creates the 2D constraint attribute
|
||||
-- defined by the planar topological attribute plane
|
||||
-- and the label label.
|
||||
returns Constraint from TDataXtd;
|
||||
|
||||
|
||||
---Purpose: Constraint methods
|
||||
-- ==================
|
||||
|
||||
Create
|
||||
returns Constraint from TDataXtd;
|
||||
|
||||
Set (me : mutable; type : ConstraintEnum from TDataXtd;
|
||||
G1 : NamedShape from TNaming);
|
||||
---Purpose:
|
||||
-- Finds or creates the constraint attribute defined
|
||||
-- by the topological attribute G1 and the constraint type type.
|
||||
Set (me : mutable; type : ConstraintEnum;
|
||||
G1 : NamedShape from TNaming;
|
||||
G2 : NamedShape from TNaming);
|
||||
---Purpose:
|
||||
-- Finds or creates the constraint attribute defined
|
||||
-- by the topological attributes G1 and G2, and by
|
||||
-- the constraint type type.
|
||||
Set (me : mutable; type : ConstraintEnum;
|
||||
G1 : NamedShape from TNaming;
|
||||
G2 : NamedShape from TNaming;
|
||||
G3 : NamedShape from TNaming);
|
||||
---Purpose:
|
||||
-- Finds or creates the constraint attribute defined
|
||||
-- by the topological attributes G1, G2 and G3, and
|
||||
-- by the constraint type type.
|
||||
Set (me : mutable; type : ConstraintEnum;
|
||||
G1 : NamedShape from TNaming;
|
||||
G2 : NamedShape from TNaming;
|
||||
G3 : NamedShape from TNaming;
|
||||
G4 : NamedShape from TNaming); ---Purpose:
|
||||
-- Finds or creates the constraint attribute defined
|
||||
-- by the topological attributes G1, G2, G3 and G4,
|
||||
-- and by the constraint type type.
|
||||
|
||||
|
||||
---Purpose: methods to read constraint fields
|
||||
-- =================================
|
||||
|
||||
Verified(me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns true if this constraint attribute is valid.
|
||||
-- By default, true is returned.
|
||||
-- When the value of a dimension is changed or
|
||||
-- when a geometry is moved, false is returned
|
||||
-- until the solver sets it back to true.
|
||||
|
||||
GetType (me)
|
||||
returns ConstraintEnum from TDataXtd;
|
||||
---Purpose:
|
||||
-- Returns the type of constraint.
|
||||
-- This will be an element of the
|
||||
-- TDataXtd_ConstraintEnum enumeration.
|
||||
|
||||
IsPlanar (me)
|
||||
---Purpose: Returns true if this constraint attribute is
|
||||
-- two-dimensional.
|
||||
returns Boolean from Standard;
|
||||
|
||||
GetPlane(me)
|
||||
---C++: return const &
|
||||
--- Purpose: Returns the topological attribute of the plane
|
||||
-- used for planar - i.e., 2D - constraints.
|
||||
-- This plane is attached to another label.
|
||||
-- If the constraint is not planar, in other words, 3D,
|
||||
-- this function will return a null handle.
|
||||
returns NamedShape from TNaming;
|
||||
|
||||
IsDimension (me)
|
||||
---Purpose: Returns true if this constraint attribute is a
|
||||
-- dimension, and therefore has a value.
|
||||
returns Boolean from Standard;
|
||||
|
||||
GetValue(me)
|
||||
---C++: return const &
|
||||
---Purpose: Returns the value of a dimension.
|
||||
-- This value is a reference to a TDataStd_Real attribute.
|
||||
-- If the attribute is not a dimension, this value will
|
||||
-- be 0. Use IsDimension to test this condition.
|
||||
returns Real from TDataStd;
|
||||
|
||||
NbGeometries (me)
|
||||
---Purpose:
|
||||
-- Returns the number of geometry attributes in this constraint attribute.
|
||||
-- This number will be between 1 and 4.
|
||||
returns Integer from Standard;
|
||||
|
||||
GetGeometry (me; Index : Integer from Standard)
|
||||
---Purpose: Returns the integer index Index used to access
|
||||
-- the array of the constraint or stored geometries of a dimension
|
||||
-- Index has a value between 1 and 4.
|
||||
returns NamedShape from TNaming;
|
||||
|
||||
|
||||
---Purpose: methods to write constraint fields (use builder)
|
||||
-- ==================================
|
||||
|
||||
ClearGeometries (me : mutable);
|
||||
---Purpose: Removes the geometries involved in the
|
||||
-- constraint or dimension from the array of
|
||||
-- topological attributes where they are stored.
|
||||
|
||||
SetType (me : mutable; CTR : ConstraintEnum from TDataXtd);
|
||||
---Purpose: Finds or creates the type of constraint CTR.
|
||||
|
||||
SetPlane(me:mutable; plane : NamedShape from TNaming);
|
||||
---Purpose: Finds or creates the plane of the 2D constraint
|
||||
-- attribute, defined by the planar topological attribute plane.
|
||||
SetValue (me : mutable; V : Real from TDataStd);
|
||||
---Purpose:
|
||||
-- Finds or creates the real number value V of the dimension constraint attribute.
|
||||
SetGeometry (me : mutable; Index : Integer from Standard; G : NamedShape from TNaming);
|
||||
---Purpose:
|
||||
-- Finds or creates the underlying geometry of the
|
||||
-- constraint defined by the topological attribute G
|
||||
-- and the integer index Index.
|
||||
Verified (me : mutable; status : Boolean from Standard);
|
||||
---Purpose:
|
||||
-- Returns true if this constraint attribute defined by status is valid.
|
||||
-- By default, true is returned.
|
||||
-- When the value of a dimension is changed or
|
||||
-- when a geometry is moved, false is returned until
|
||||
-- the solver sets it back to true.
|
||||
-- If status is false, Verified is set to false.
|
||||
|
||||
-- Category: Angle management
|
||||
-- ==========================
|
||||
|
||||
Inverted(me:mutable; status : Boolean from Standard);
|
||||
Inverted(me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
Reversed(me:mutable; status : Boolean from Standard);
|
||||
Reversed(me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
-- Category: Chirality management for DCM
|
||||
-- ======================================
|
||||
|
||||
--ChangeChirality (me:mutable; status : Boolean from Standard);
|
||||
--ChangeChirality (me)
|
||||
--returns Boolean from Standard;
|
||||
|
||||
|
||||
---Category: Utilities
|
||||
-- =========
|
||||
|
||||
CollectChildConstraints(myclass;
|
||||
aLabel : Label from TDF;
|
||||
TheList:in out LabelList from TDF);
|
||||
---Purpose: collects constraints on Childs for label <aLabel>
|
||||
|
||||
|
||||
---Category: TDF_Attribute methods
|
||||
-- =====================
|
||||
|
||||
ID (me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore (me: mutable; With : Attribute from TDF);
|
||||
|
||||
NewEmpty (me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; Into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
Dump (me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
References (me; DS : DataSet from TDF) is redefined;
|
||||
|
||||
fields
|
||||
|
||||
myType : ConstraintEnum from TDataXtd;
|
||||
myValue : Real from TDataStd;
|
||||
myGeometries : Attribute from TDF[4];
|
||||
myPlane : Attribute from TDF;
|
||||
myIsReversed : Boolean from Standard;
|
||||
myIsInverted : Boolean from Standard;
|
||||
myIsVerified : Boolean from Standard;
|
||||
|
||||
end Constraint;
|
@@ -12,21 +12,27 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Constraint.ixx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDataXtd_Constraint.hxx>
|
||||
#include <TDataXtd_ConstraintEnum.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_DataSet.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// for symmetry midpoint the third argument is the axis or the point
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Constraint::GetID ()
|
||||
{
|
||||
static Standard_GUID TDataXtd_ConstraintID("2a96b602-ec8b-11d0-bee7-080009dc3333");
|
||||
|
224
src/TDataXtd/TDataXtd_Constraint.hxx
Normal file
224
src/TDataXtd/TDataXtd_Constraint.hxx
Normal file
@@ -0,0 +1,224 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Constraint_HeaderFile
|
||||
#define _TDataXtd_Constraint_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDataXtd_ConstraintEnum.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TDF_LabelList.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class TDataStd_Real;
|
||||
class TDF_Attribute;
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class TNaming_NamedShape;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_DataSet;
|
||||
|
||||
|
||||
class TDataXtd_Constraint;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Constraint, TDF_Attribute)
|
||||
|
||||
//! The groundwork to define constraint attributes.
|
||||
//! The constraint attribute contains the following sorts of data:
|
||||
//! - Type whether the constraint attribute is a
|
||||
//! geometric constraint or a dimension
|
||||
//! - Value the real number value of a numeric
|
||||
//! constraint such as an angle or a radius
|
||||
//! - Geometries to identify the geometries
|
||||
//! underlying the topological attributes which
|
||||
//! define the constraint (up to 4)
|
||||
//! - Plane for 2D constraints.
|
||||
class TDataXtd_Constraint : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns the GUID for constraints.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Finds or creates the 2D constraint attribute
|
||||
//! defined by the planar topological attribute plane
|
||||
//! and the label label.
|
||||
//! Constraint methods
|
||||
//! ==================
|
||||
Standard_EXPORT static Handle(TDataXtd_Constraint) Set (const TDF_Label& label);
|
||||
|
||||
Standard_EXPORT TDataXtd_Constraint();
|
||||
|
||||
|
||||
//! Finds or creates the constraint attribute defined
|
||||
//! by the topological attribute G1 and the constraint type type.
|
||||
Standard_EXPORT void Set (const TDataXtd_ConstraintEnum type, const Handle(TNaming_NamedShape)& G1);
|
||||
|
||||
|
||||
//! Finds or creates the constraint attribute defined
|
||||
//! by the topological attributes G1 and G2, and by
|
||||
//! the constraint type type.
|
||||
Standard_EXPORT void Set (const TDataXtd_ConstraintEnum type, const Handle(TNaming_NamedShape)& G1, const Handle(TNaming_NamedShape)& G2);
|
||||
|
||||
|
||||
//! Finds or creates the constraint attribute defined
|
||||
//! by the topological attributes G1, G2 and G3, and
|
||||
//! by the constraint type type.
|
||||
Standard_EXPORT void Set (const TDataXtd_ConstraintEnum type, const Handle(TNaming_NamedShape)& G1, const Handle(TNaming_NamedShape)& G2, const Handle(TNaming_NamedShape)& G3);
|
||||
|
||||
|
||||
//! Finds or creates the constraint attribute defined
|
||||
//! by the topological attributes G1, G2, G3 and G4,
|
||||
//! and by the constraint type type.
|
||||
//! methods to read constraint fields
|
||||
//! =================================
|
||||
Standard_EXPORT void Set (const TDataXtd_ConstraintEnum type, const Handle(TNaming_NamedShape)& G1, const Handle(TNaming_NamedShape)& G2, const Handle(TNaming_NamedShape)& G3, const Handle(TNaming_NamedShape)& G4);
|
||||
|
||||
|
||||
//! Returns true if this constraint attribute is valid.
|
||||
//! By default, true is returned.
|
||||
//! When the value of a dimension is changed or
|
||||
//! when a geometry is moved, false is returned
|
||||
//! until the solver sets it back to true.
|
||||
Standard_EXPORT Standard_Boolean Verified() const;
|
||||
|
||||
|
||||
//! Returns the type of constraint.
|
||||
//! This will be an element of the
|
||||
//! TDataXtd_ConstraintEnum enumeration.
|
||||
Standard_EXPORT TDataXtd_ConstraintEnum GetType() const;
|
||||
|
||||
//! Returns true if this constraint attribute is
|
||||
//! two-dimensional.
|
||||
Standard_EXPORT Standard_Boolean IsPlanar() const;
|
||||
|
||||
//! Returns the topological attribute of the plane
|
||||
//! used for planar - i.e., 2D - constraints.
|
||||
//! This plane is attached to another label.
|
||||
//! If the constraint is not planar, in other words, 3D,
|
||||
//! this function will return a null handle.
|
||||
Standard_EXPORT const Handle(TNaming_NamedShape)& GetPlane() const;
|
||||
|
||||
//! Returns true if this constraint attribute is a
|
||||
//! dimension, and therefore has a value.
|
||||
Standard_EXPORT Standard_Boolean IsDimension() const;
|
||||
|
||||
//! Returns the value of a dimension.
|
||||
//! This value is a reference to a TDataStd_Real attribute.
|
||||
//! If the attribute is not a dimension, this value will
|
||||
//! be 0. Use IsDimension to test this condition.
|
||||
Standard_EXPORT const Handle(TDataStd_Real)& GetValue() const;
|
||||
|
||||
|
||||
//! Returns the number of geometry attributes in this constraint attribute.
|
||||
//! This number will be between 1 and 4.
|
||||
Standard_EXPORT Standard_Integer NbGeometries() const;
|
||||
|
||||
//! Returns the integer index Index used to access
|
||||
//! the array of the constraint or stored geometries of a dimension
|
||||
//! Index has a value between 1 and 4.
|
||||
//! methods to write constraint fields (use builder)
|
||||
//! ==================================
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) GetGeometry (const Standard_Integer Index) const;
|
||||
|
||||
//! Removes the geometries involved in the
|
||||
//! constraint or dimension from the array of
|
||||
//! topological attributes where they are stored.
|
||||
Standard_EXPORT void ClearGeometries();
|
||||
|
||||
//! Finds or creates the type of constraint CTR.
|
||||
Standard_EXPORT void SetType (const TDataXtd_ConstraintEnum CTR);
|
||||
|
||||
//! Finds or creates the plane of the 2D constraint
|
||||
//! attribute, defined by the planar topological attribute plane.
|
||||
Standard_EXPORT void SetPlane (const Handle(TNaming_NamedShape)& plane);
|
||||
|
||||
|
||||
//! Finds or creates the real number value V of the dimension constraint attribute.
|
||||
Standard_EXPORT void SetValue (const Handle(TDataStd_Real)& V);
|
||||
|
||||
|
||||
//! Finds or creates the underlying geometry of the
|
||||
//! constraint defined by the topological attribute G
|
||||
//! and the integer index Index.
|
||||
Standard_EXPORT void SetGeometry (const Standard_Integer Index, const Handle(TNaming_NamedShape)& G);
|
||||
|
||||
|
||||
//! Returns true if this constraint attribute defined by status is valid.
|
||||
//! By default, true is returned.
|
||||
//! When the value of a dimension is changed or
|
||||
//! when a geometry is moved, false is returned until
|
||||
//! the solver sets it back to true.
|
||||
//! If status is false, Verified is set to false.
|
||||
Standard_EXPORT void Verified (const Standard_Boolean status);
|
||||
|
||||
Standard_EXPORT void Inverted (const Standard_Boolean status);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Inverted() const;
|
||||
|
||||
Standard_EXPORT void Reversed (const Standard_Boolean status);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Reversed() const;
|
||||
|
||||
//! collects constraints on Childs for label <aLabel>
|
||||
Standard_EXPORT static void CollectChildConstraints (const TDF_Label& aLabel, TDF_LabelList& TheList);
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& DS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Constraint,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TDataXtd_ConstraintEnum myType;
|
||||
Handle(TDataStd_Real) myValue;
|
||||
Handle(TDF_Attribute) myGeometries[4];
|
||||
Handle(TDF_Attribute) myPlane;
|
||||
Standard_Boolean myIsReversed;
|
||||
Standard_Boolean myIsInverted;
|
||||
Standard_Boolean myIsVerified;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Constraint_HeaderFile
|
52
src/TDataXtd/TDataXtd_ConstraintEnum.hxx
Normal file
52
src/TDataXtd/TDataXtd_ConstraintEnum.hxx
Normal file
@@ -0,0 +1,52 @@
|
||||
// Created on: 2008-05-29
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2008-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_ConstraintEnum_HeaderFile
|
||||
#define _TDataXtd_ConstraintEnum_HeaderFile
|
||||
|
||||
//! The terms of this enumeration define the types
|
||||
//! of available constraint.
|
||||
//! ==================
|
||||
enum TDataXtd_ConstraintEnum
|
||||
{
|
||||
TDataXtd_RADIUS,
|
||||
TDataXtd_DIAMETER,
|
||||
TDataXtd_MINOR_RADIUS,
|
||||
TDataXtd_MAJOR_RADIUS,
|
||||
TDataXtd_TANGENT,
|
||||
TDataXtd_PARALLEL,
|
||||
TDataXtd_PERPENDICULAR,
|
||||
TDataXtd_CONCENTRIC,
|
||||
TDataXtd_COINCIDENT,
|
||||
TDataXtd_DISTANCE,
|
||||
TDataXtd_ANGLE,
|
||||
TDataXtd_EQUAL_RADIUS,
|
||||
TDataXtd_SYMMETRY,
|
||||
TDataXtd_MIDPOINT,
|
||||
TDataXtd_EQUAL_DISTANCE,
|
||||
TDataXtd_FIX,
|
||||
TDataXtd_RIGID,
|
||||
TDataXtd_FROM,
|
||||
TDataXtd_AXIS,
|
||||
TDataXtd_MATE,
|
||||
TDataXtd_ALIGN_FACES,
|
||||
TDataXtd_ALIGN_AXES,
|
||||
TDataXtd_AXES_ANGLE,
|
||||
TDataXtd_FACES_ANGLE,
|
||||
TDataXtd_ROUND,
|
||||
TDataXtd_OFFSET
|
||||
};
|
||||
|
||||
#endif // _TDataXtd_ConstraintEnum_HeaderFile
|
@@ -1,186 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Geometry from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose: This class is used to model construction geometry.
|
||||
-- The specific geometric construction of the
|
||||
-- attribute is defined by an element of the
|
||||
-- enumeration TDataXtd_GeometryEnum.
|
||||
-- This attribute may also be used to qualify underlying
|
||||
-- geometry of the associated NamedShape. for
|
||||
-- Constructuion element by example.
|
||||
|
||||
uses Attribute from TDF,
|
||||
Label from TDF,
|
||||
GUID from Standard,
|
||||
GeometryEnum from TDataXtd,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF,
|
||||
NamedShape from TNaming,
|
||||
Pnt from gp,
|
||||
Ax1 from gp,
|
||||
Lin from gp,
|
||||
Circ from gp,
|
||||
Elips from gp,
|
||||
Pln from gp,
|
||||
Cylinder from gp
|
||||
|
||||
|
||||
|
||||
|
||||
is
|
||||
|
||||
---Purpose: API class methods
|
||||
-- =================
|
||||
|
||||
Set (myclass ; label : Label from TDF)
|
||||
---Purpose: Finds, or creates, a Geometry attribute defined by the label label.
|
||||
-- The default type of geometry is the value
|
||||
-- ANY_GEOM of the enumeration TDataXtd_GeometryEnum.
|
||||
-- To specify another value of this enumeration, use
|
||||
-- the function SetType.
|
||||
|
||||
returns Geometry from TDataXtd;
|
||||
|
||||
Type (myclass; L : Label from TDF)
|
||||
returns GeometryEnum from TDataXtd;
|
||||
---Purpose:
|
||||
-- Returns the label L used to define the type of
|
||||
-- geometric construction for the geometry attribute.
|
||||
Type (myclass; S : NamedShape from TNaming)
|
||||
returns GeometryEnum from TDataXtd;
|
||||
---Purpose: Returns the topological attribute S used to define
|
||||
-- the type of geometric construction for the geometry attribute.
|
||||
Point (myclass; L : Label from TDF; G : in out Pnt from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the point attribute defined by the label L and the point G.
|
||||
Point (myclass; S : NamedShape from TNaming; G : in out Pnt from gp)
|
||||
---Purpose:
|
||||
-- Returns the point attribute defined by the topological attribute S and the point G.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
Axis (myclass; L : Label from TDF; G : in out Ax1 from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the axis attribute defined by the label L and the axis G.
|
||||
Axis (myclass; S : NamedShape from TNaming; G : in out Ax1 from gp)
|
||||
---Purpose:
|
||||
-- Returns the axis attribute defined by the topological attribute S and the axis G.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
Line (myclass; L : Label from TDF; G : in out Lin from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the line attribute defined by the label L and the line G.
|
||||
|
||||
Line (myclass; S : NamedShape from TNaming; G : in out Lin from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the line attribute defined by the topological attribute S and the line G.
|
||||
|
||||
Circle (myclass; L : Label from TDF; G : in out Circ from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the circle attribute defined by the label L and the circle G.
|
||||
Circle (myclass; S : NamedShape from TNaming; G : in out Circ from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the circle attribute defined by the topological attribute S and the circle G.
|
||||
|
||||
Ellipse (myclass; L : Label from TDF; G : in out Elips from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the ellipse attribute defined by the label L and the ellipse G.
|
||||
Ellipse (myclass; S : NamedShape from TNaming; G : in out Elips from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the ellipse attribute defined by the
|
||||
-- topological attribute S and the ellipse G.
|
||||
|
||||
Plane (myclass; L : Label from TDF; G : in out Pln from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the plane attribute defined by the label L and the plane G.
|
||||
Plane (myclass; S : NamedShape from TNaming; G : in out Pln from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns the plane attribute defined by the
|
||||
-- topological attribute S and the plane G.
|
||||
|
||||
Cylinder (myclass; L : Label from TDF; G : in out Cylinder from gp)
|
||||
---Purpose:
|
||||
-- Returns the cylinder attribute defined by the label L and the cylinder G.
|
||||
returns Boolean from Standard;
|
||||
|
||||
Cylinder (myclass; S : NamedShape from TNaming; G : in out Cylinder from gp)
|
||||
---Purpose:
|
||||
-- Returns the cylinder attribute defined by the
|
||||
-- topological attribute S and the cylinder G.
|
||||
returns Boolean from Standard;
|
||||
|
||||
GetID(myclass)
|
||||
---C++: return const &
|
||||
---Purpose: Returns the GUID for geometry attributes.
|
||||
returns GUID from Standard;
|
||||
|
||||
|
||||
|
||||
Create
|
||||
returns Geometry from TDataXtd;
|
||||
---Purpose: This and the next methods are used to retrieve underlying geometry of the
|
||||
-- NamedShape, even if noone Geometry Attribute is
|
||||
-- associated . if not found or not compliant geometry return False.
|
||||
|
||||
|
||||
SetType (me : mutable; T : GeometryEnum from TDataXtd);
|
||||
---Purpose: Returns the type of geometric construction T of this attribute.
|
||||
-- T will be a value of the enumeration TDataXtd_GeometryEnum.
|
||||
|
||||
GetType (me)
|
||||
returns GeometryEnum from TDataXtd;
|
||||
---Purpose: Returns the type of geometric construction.
|
||||
|
||||
---Category: TDF_Attribute methods
|
||||
-- =====================
|
||||
|
||||
ID(me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore(me: mutable; with : Attribute from TDF);
|
||||
|
||||
NewEmpty(me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
fields
|
||||
|
||||
myType : GeometryEnum from TDataXtd;
|
||||
|
||||
end Geometry;
|
||||
|
||||
|
||||
|
@@ -12,39 +12,45 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Geometry.ixx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Geometry::GetID ()
|
||||
{
|
||||
static Standard_GUID TDataXtd_GeometryID ("2a96b604-ec8b-11d0-bee7-080009dc3333");
|
||||
|
182
src/TDataXtd/TDataXtd_Geometry.hxx
Normal file
182
src/TDataXtd/TDataXtd_Geometry.hxx
Normal file
@@ -0,0 +1,182 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Geometry_HeaderFile
|
||||
#define _TDataXtd_Geometry_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDataXtd_GeometryEnum.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class TDF_Label;
|
||||
class TNaming_NamedShape;
|
||||
class gp_Pnt;
|
||||
class gp_Ax1;
|
||||
class gp_Lin;
|
||||
class gp_Circ;
|
||||
class gp_Elips;
|
||||
class gp_Pln;
|
||||
class gp_Cylinder;
|
||||
class Standard_GUID;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
class TDataXtd_Geometry;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Geometry, TDF_Attribute)
|
||||
|
||||
//! This class is used to model construction geometry.
|
||||
//! The specific geometric construction of the
|
||||
//! attribute is defined by an element of the
|
||||
//! enumeration TDataXtd_GeometryEnum.
|
||||
//! This attribute may also be used to qualify underlying
|
||||
//! geometry of the associated NamedShape. for
|
||||
//! Constructuion element by example.
|
||||
class TDataXtd_Geometry : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! API class methods
|
||||
//! =================
|
||||
//! Finds, or creates, a Geometry attribute defined by the label label.
|
||||
//! The default type of geometry is the value
|
||||
//! ANY_GEOM of the enumeration TDataXtd_GeometryEnum.
|
||||
//! To specify another value of this enumeration, use
|
||||
//! the function SetType.
|
||||
Standard_EXPORT static Handle(TDataXtd_Geometry) Set (const TDF_Label& label);
|
||||
|
||||
|
||||
//! Returns the label L used to define the type of
|
||||
//! geometric construction for the geometry attribute.
|
||||
Standard_EXPORT static TDataXtd_GeometryEnum Type (const TDF_Label& L);
|
||||
|
||||
//! Returns the topological attribute S used to define
|
||||
//! the type of geometric construction for the geometry attribute.
|
||||
Standard_EXPORT static TDataXtd_GeometryEnum Type (const Handle(TNaming_NamedShape)& S);
|
||||
|
||||
|
||||
//! Returns the point attribute defined by the label L and the point G.
|
||||
Standard_EXPORT static Standard_Boolean Point (const TDF_Label& L, gp_Pnt& G);
|
||||
|
||||
|
||||
//! Returns the point attribute defined by the topological attribute S and the point G.
|
||||
Standard_EXPORT static Standard_Boolean Point (const Handle(TNaming_NamedShape)& S, gp_Pnt& G);
|
||||
|
||||
|
||||
//! Returns the axis attribute defined by the label L and the axis G.
|
||||
Standard_EXPORT static Standard_Boolean Axis (const TDF_Label& L, gp_Ax1& G);
|
||||
|
||||
|
||||
//! Returns the axis attribute defined by the topological attribute S and the axis G.
|
||||
Standard_EXPORT static Standard_Boolean Axis (const Handle(TNaming_NamedShape)& S, gp_Ax1& G);
|
||||
|
||||
|
||||
//! Returns the line attribute defined by the label L and the line G.
|
||||
Standard_EXPORT static Standard_Boolean Line (const TDF_Label& L, gp_Lin& G);
|
||||
|
||||
|
||||
//! Returns the line attribute defined by the topological attribute S and the line G.
|
||||
Standard_EXPORT static Standard_Boolean Line (const Handle(TNaming_NamedShape)& S, gp_Lin& G);
|
||||
|
||||
|
||||
//! Returns the circle attribute defined by the label L and the circle G.
|
||||
Standard_EXPORT static Standard_Boolean Circle (const TDF_Label& L, gp_Circ& G);
|
||||
|
||||
|
||||
//! Returns the circle attribute defined by the topological attribute S and the circle G.
|
||||
Standard_EXPORT static Standard_Boolean Circle (const Handle(TNaming_NamedShape)& S, gp_Circ& G);
|
||||
|
||||
|
||||
//! Returns the ellipse attribute defined by the label L and the ellipse G.
|
||||
Standard_EXPORT static Standard_Boolean Ellipse (const TDF_Label& L, gp_Elips& G);
|
||||
|
||||
|
||||
//! Returns the ellipse attribute defined by the
|
||||
//! topological attribute S and the ellipse G.
|
||||
Standard_EXPORT static Standard_Boolean Ellipse (const Handle(TNaming_NamedShape)& S, gp_Elips& G);
|
||||
|
||||
|
||||
//! Returns the plane attribute defined by the label L and the plane G.
|
||||
Standard_EXPORT static Standard_Boolean Plane (const TDF_Label& L, gp_Pln& G);
|
||||
|
||||
|
||||
//! Returns the plane attribute defined by the
|
||||
//! topological attribute S and the plane G.
|
||||
Standard_EXPORT static Standard_Boolean Plane (const Handle(TNaming_NamedShape)& S, gp_Pln& G);
|
||||
|
||||
|
||||
//! Returns the cylinder attribute defined by the label L and the cylinder G.
|
||||
Standard_EXPORT static Standard_Boolean Cylinder (const TDF_Label& L, gp_Cylinder& G);
|
||||
|
||||
|
||||
//! Returns the cylinder attribute defined by the
|
||||
//! topological attribute S and the cylinder G.
|
||||
Standard_EXPORT static Standard_Boolean Cylinder (const Handle(TNaming_NamedShape)& S, gp_Cylinder& G);
|
||||
|
||||
//! Returns the GUID for geometry attributes.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! This and the next methods are used to retrieve underlying geometry of the
|
||||
//! NamedShape, even if noone Geometry Attribute is
|
||||
//! associated . if not found or not compliant geometry return False.
|
||||
Standard_EXPORT TDataXtd_Geometry();
|
||||
|
||||
//! Returns the type of geometric construction T of this attribute.
|
||||
//! T will be a value of the enumeration TDataXtd_GeometryEnum.
|
||||
Standard_EXPORT void SetType (const TDataXtd_GeometryEnum T);
|
||||
|
||||
//! Returns the type of geometric construction.
|
||||
Standard_EXPORT TDataXtd_GeometryEnum GetType() const;
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Geometry,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TDataXtd_GeometryEnum myType;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Geometry_HeaderFile
|
33
src/TDataXtd/TDataXtd_GeometryEnum.hxx
Normal file
33
src/TDataXtd/TDataXtd_GeometryEnum.hxx
Normal file
@@ -0,0 +1,33 @@
|
||||
// Created on: 2008-05-29
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2008-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_GeometryEnum_HeaderFile
|
||||
#define _TDataXtd_GeometryEnum_HeaderFile
|
||||
|
||||
|
||||
//! The terms of this enumeration define the types of geometric shapes available.
|
||||
enum TDataXtd_GeometryEnum
|
||||
{
|
||||
TDataXtd_ANY_GEOM,
|
||||
TDataXtd_POINT,
|
||||
TDataXtd_LINE,
|
||||
TDataXtd_CIRCLE,
|
||||
TDataXtd_ELLIPSE,
|
||||
TDataXtd_SPLINE,
|
||||
TDataXtd_PLANE,
|
||||
TDataXtd_CYLINDER
|
||||
};
|
||||
|
||||
#endif // _TDataXtd_GeometryEnum_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class Pattern from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose: a general pattern model
|
||||
|
||||
uses
|
||||
Array1OfTrsf from TDataXtd,
|
||||
LabelList from TDF,
|
||||
GUID from Standard
|
||||
|
||||
is
|
||||
|
||||
GetID (myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
ID(me)
|
||||
returns GUID from Standard
|
||||
is redefined static;
|
||||
---Purpose: Returns the ID of the attribute.
|
||||
--
|
||||
---C++: return const &
|
||||
|
||||
PatternID(me)
|
||||
returns GUID from Standard
|
||||
is deferred;
|
||||
---Purpose: Returns the ID of the attribute.
|
||||
--
|
||||
---C++: return const &
|
||||
|
||||
NbTrsfs(me)
|
||||
returns Integer from Standard
|
||||
is deferred;
|
||||
---Purpose: Give the number of transformation
|
||||
|
||||
ComputeTrsfs(me; Trsfs : in out Array1OfTrsf from TDataXtd)
|
||||
is deferred;
|
||||
---Purpose: Give the transformations
|
||||
|
||||
end Pattern;
|
||||
|
||||
|
@@ -13,12 +13,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Pattern.ixx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataXtd_Pattern.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Pattern::GetID()
|
||||
{
|
||||
static Standard_GUID myID("2a96b618-ec8b-11d0-bee7-080009dc3333");
|
||||
|
75
src/TDataXtd/TDataXtd_Pattern.hxx
Normal file
75
src/TDataXtd/TDataXtd_Pattern.hxx
Normal file
@@ -0,0 +1,75 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Pattern_HeaderFile
|
||||
#define _TDataXtd_Pattern_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TDataXtd_Array1OfTrsf.hxx>
|
||||
class Standard_GUID;
|
||||
|
||||
|
||||
class TDataXtd_Pattern;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Pattern, TDF_Attribute)
|
||||
|
||||
//! a general pattern model
|
||||
class TDataXtd_Pattern : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Returns the ID of the attribute.
|
||||
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the ID of the attribute.
|
||||
Standard_EXPORT virtual const Standard_GUID& PatternID() const = 0;
|
||||
|
||||
//! Give the number of transformation
|
||||
Standard_EXPORT virtual Standard_Integer NbTrsfs() const = 0;
|
||||
|
||||
//! Give the transformations
|
||||
Standard_EXPORT virtual void ComputeTrsfs (TDataXtd_Array1OfTrsf& Trsfs) const = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Pattern,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Pattern_HeaderFile
|
@@ -1,163 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class PatternStd from TDataXtd inherits Pattern from TDataXtd
|
||||
|
||||
---Purpose: to create a PatternStd
|
||||
-- (LinearPattern, CircularPattern, RectangularPattern,
|
||||
-- RadialCircularPattern, MirrorPattern)
|
||||
|
||||
uses
|
||||
|
||||
Label from TDF,
|
||||
Attribute from TDF,
|
||||
RelocationTable from TDF,
|
||||
DataSet from TDF,
|
||||
NamedShape from TNaming,
|
||||
Real from TDataStd,
|
||||
Integer from TDataStd,
|
||||
Array1OfTrsf from TDataXtd,
|
||||
OStream from Standard,
|
||||
GUID from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
---Category: class methods
|
||||
-- =============
|
||||
|
||||
GetPatternID(myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Set (myclass ; label : Label from TDF)
|
||||
returns PatternStd from TDataXtd;
|
||||
---Purpose: Find, or create, a PatternStd attribute
|
||||
|
||||
|
||||
---Category: constructor
|
||||
-- ===========
|
||||
|
||||
Create
|
||||
returns PatternStd from TDataXtd;
|
||||
|
||||
--- Category: Set and Get methods
|
||||
|
||||
Signature(me: mutable; signature: Integer from Standard);
|
||||
-- Use SetSignature to set the signature
|
||||
-- signature = 1 : linear PatternStd
|
||||
-- (axis1 + dist1 + nb1)
|
||||
-- = 2 : circular PatternStd
|
||||
-- (axis1 + angle + nb1)
|
||||
-- = 3 : rentagular PatternStd
|
||||
-- (axis1 + dist1 + nb1 + axis2 + dist2 + nb2)
|
||||
-- = 4 : circular rectangulaire PatternStd
|
||||
-- (axis1 + dist1 + nb1 + axis2 + angle + nb2)
|
||||
-- = 5 : mirror PatternStd
|
||||
-- (plane)
|
||||
|
||||
Axis1(me: mutable; Axis1: NamedShape from TNaming);
|
||||
|
||||
Axis2(me: mutable; Axis2: NamedShape from TNaming);
|
||||
|
||||
Axis1Reversed(me: mutable; Axis1Reversed: Boolean from Standard);
|
||||
|
||||
Axis2Reversed(me: mutable; Axis2Reversed: Boolean from Standard);
|
||||
|
||||
Value1(me: mutable; value : Real from TDataStd);
|
||||
|
||||
Value2(me: mutable; value : Real from TDataStd);
|
||||
|
||||
NbInstances1(me: mutable; NbInstances1: Integer from TDataStd);
|
||||
|
||||
NbInstances2(me: mutable; NbInstances2: Integer from TDataStd);
|
||||
|
||||
Mirror(me: mutable; plane: NamedShape from TNaming);
|
||||
|
||||
Signature(me) returns Integer from Standard;
|
||||
---C++: inline
|
||||
|
||||
Axis1(me) returns NamedShape from TNaming;
|
||||
---C++: inline
|
||||
|
||||
Axis2(me) returns NamedShape from TNaming;
|
||||
---C++: inline
|
||||
|
||||
Axis1Reversed(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
Axis2Reversed(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
Value1(me) returns Real from TDataStd;
|
||||
---C++: inline
|
||||
|
||||
Value2(me) returns Real from TDataStd;
|
||||
---C++: inline
|
||||
|
||||
NbInstances1(me) returns Integer from TDataStd;
|
||||
---C++: inline
|
||||
|
||||
NbInstances2(me) returns Integer from TDataStd;
|
||||
---C++: inline
|
||||
|
||||
Mirror(me) returns NamedShape from TNaming;
|
||||
---C++: inline
|
||||
|
||||
--- Category: TDataXtd_Pattern methods
|
||||
|
||||
NbTrsfs(me) returns Integer from Standard;
|
||||
|
||||
ComputeTrsfs(me; Trsfs: in out Array1OfTrsf from TDataXtd);
|
||||
|
||||
|
||||
---Category: Deferred methods from TDF_Attribute
|
||||
|
||||
PatternID (me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore (me: mutable; With : Attribute from TDF);
|
||||
|
||||
NewEmpty (me) returns Attribute from TDF;
|
||||
|
||||
Paste (me; Into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
References(me; aDataSet : DataSet from TDF)
|
||||
is redefined;
|
||||
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
---C++: return &
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
mySignature : Integer from Standard;
|
||||
myAxis1Reversed : Boolean from Standard;
|
||||
myAxis2Reversed : Boolean from Standard;
|
||||
|
||||
myAxis1 : NamedShape from TNaming;
|
||||
myAxis2 : NamedShape from TNaming;
|
||||
myValue1 : Real from TDataStd;
|
||||
myValue2 : Real from TDataStd;
|
||||
myNb1 : Integer from TDataStd;
|
||||
myNb2 : Integer from TDataStd;
|
||||
myMirror : NamedShape from TNaming;
|
||||
|
||||
end PatternStd;
|
||||
|
@@ -13,23 +13,30 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_PatternStd.ixx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
#include <TDataXtd_PatternStd.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_DataSet.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPatternID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_PatternStd::GetPatternID()
|
||||
{
|
||||
static Standard_GUID TDataXtd_PatternStdID("2a96b61b-ec8b-11d0-bee7-080009dc3333");
|
||||
|
146
src/TDataXtd/TDataXtd_PatternStd.hxx
Normal file
146
src/TDataXtd/TDataXtd_PatternStd.hxx
Normal file
@@ -0,0 +1,146 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_PatternStd_HeaderFile
|
||||
#define _TDataXtd_PatternStd_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDataXtd_Pattern.hxx>
|
||||
#include <TDataXtd_Array1OfTrsf.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class TNaming_NamedShape;
|
||||
class TDataStd_Real;
|
||||
class TDataStd_Integer;
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_DataSet;
|
||||
|
||||
|
||||
class TDataXtd_PatternStd;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_PatternStd, TDataXtd_Pattern)
|
||||
|
||||
//! to create a PatternStd
|
||||
//! (LinearPattern, CircularPattern, RectangularPattern,
|
||||
//! RadialCircularPattern, MirrorPattern)
|
||||
class TDataXtd_PatternStd : public TDataXtd_Pattern
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT static const Standard_GUID& GetPatternID();
|
||||
|
||||
//! Find, or create, a PatternStd attribute
|
||||
Standard_EXPORT static Handle(TDataXtd_PatternStd) Set (const TDF_Label& label);
|
||||
|
||||
Standard_EXPORT TDataXtd_PatternStd();
|
||||
|
||||
Standard_EXPORT void Signature (const Standard_Integer signature);
|
||||
|
||||
Standard_EXPORT void Axis1 (const Handle(TNaming_NamedShape)& Axis1);
|
||||
|
||||
Standard_EXPORT void Axis2 (const Handle(TNaming_NamedShape)& Axis2);
|
||||
|
||||
Standard_EXPORT void Axis1Reversed (const Standard_Boolean Axis1Reversed);
|
||||
|
||||
Standard_EXPORT void Axis2Reversed (const Standard_Boolean Axis2Reversed);
|
||||
|
||||
Standard_EXPORT void Value1 (const Handle(TDataStd_Real)& value);
|
||||
|
||||
Standard_EXPORT void Value2 (const Handle(TDataStd_Real)& value);
|
||||
|
||||
Standard_EXPORT void NbInstances1 (const Handle(TDataStd_Integer)& NbInstances1);
|
||||
|
||||
Standard_EXPORT void NbInstances2 (const Handle(TDataStd_Integer)& NbInstances2);
|
||||
|
||||
Standard_EXPORT void Mirror (const Handle(TNaming_NamedShape)& plane);
|
||||
|
||||
Standard_Integer Signature() const;
|
||||
|
||||
Handle(TNaming_NamedShape) Axis1() const;
|
||||
|
||||
Handle(TNaming_NamedShape) Axis2() const;
|
||||
|
||||
Standard_Boolean Axis1Reversed() const;
|
||||
|
||||
Standard_Boolean Axis2Reversed() const;
|
||||
|
||||
Handle(TDataStd_Real) Value1() const;
|
||||
|
||||
Handle(TDataStd_Real) Value2() const;
|
||||
|
||||
Handle(TDataStd_Integer) NbInstances1() const;
|
||||
|
||||
Handle(TDataStd_Integer) NbInstances2() const;
|
||||
|
||||
Handle(TNaming_NamedShape) Mirror() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbTrsfs() const;
|
||||
|
||||
Standard_EXPORT void ComputeTrsfs (TDataXtd_Array1OfTrsf& Trsfs) const;
|
||||
|
||||
Standard_EXPORT const Standard_GUID& PatternID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_PatternStd,TDataXtd_Pattern)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer mySignature;
|
||||
Standard_Boolean myAxis1Reversed;
|
||||
Standard_Boolean myAxis2Reversed;
|
||||
Handle(TNaming_NamedShape) myAxis1;
|
||||
Handle(TNaming_NamedShape) myAxis2;
|
||||
Handle(TDataStd_Real) myValue1;
|
||||
Handle(TDataStd_Real) myValue2;
|
||||
Handle(TDataStd_Integer) myNb1;
|
||||
Handle(TDataStd_Integer) myNb2;
|
||||
Handle(TNaming_NamedShape) myMirror;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TDataXtd_PatternStd.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_PatternStd_HeaderFile
|
@@ -1,73 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Placement from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses Attribute from TDF,
|
||||
Label from TDF,
|
||||
GUID from Standard,
|
||||
Integer from Standard,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF,
|
||||
Constraint from TDataXtd
|
||||
|
||||
is
|
||||
|
||||
---Purpose: class methods
|
||||
-- =============
|
||||
|
||||
|
||||
GetID (myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
|
||||
Set (myclass; label : Label from TDF)
|
||||
---Purpose: Find, or create, an Placement attribute. the
|
||||
-- Placement attribute is returned.
|
||||
returns Placement from TDataXtd;
|
||||
|
||||
|
||||
---Purpose: Placement methods
|
||||
-- =================
|
||||
|
||||
|
||||
Create
|
||||
returns Placement from TDataXtd;
|
||||
|
||||
---Category: TDF_Attribute methods
|
||||
-- =====================
|
||||
|
||||
ID (me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore (me: mutable; With : Attribute from TDF);
|
||||
|
||||
NewEmpty (me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; Into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
Dump (me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
end Placement;
|
||||
|
@@ -13,12 +13,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Placement.ixx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataXtd_Placement.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Placement::GetID ()
|
||||
{
|
||||
static Standard_GUID TDataXtd_PlacementID ("2a96b60b-ec8b-11d0-bee7-080009dc3333");
|
||||
|
85
src/TDataXtd/TDataXtd_Placement.hxx
Normal file
85
src/TDataXtd/TDataXtd_Placement.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Placement_HeaderFile
|
||||
#define _TDataXtd_Placement_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
class TDataXtd_Placement;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Placement, TDF_Attribute)
|
||||
|
||||
|
||||
class TDataXtd_Placement : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! class methods
|
||||
//! =============
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Find, or create, an Placement attribute. the
|
||||
//! Placement attribute is returned.
|
||||
//! Placement methods
|
||||
//! =================
|
||||
Standard_EXPORT static Handle(TDataXtd_Placement) Set (const TDF_Label& label);
|
||||
|
||||
Standard_EXPORT TDataXtd_Placement();
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Placement,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Placement_HeaderFile
|
@@ -1,85 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Plane from TDataXtd inherits Attribute from TDF
|
||||
|
||||
|
||||
---Purpose: The basis to define a plane attribute.
|
||||
-- Warning: Use TDataXtd_Geometry attribute to retrieve the
|
||||
-- gp_Pln of the Plane attribute
|
||||
|
||||
uses Attribute from TDF,
|
||||
Label from TDF,
|
||||
GUID from Standard,
|
||||
Label from TDF,
|
||||
Plane from Geom,
|
||||
Pln from gp,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF
|
||||
|
||||
is
|
||||
|
||||
---Purpose: class methods
|
||||
-- =============
|
||||
|
||||
GetID (myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
---Purpose:
|
||||
-- Returns the GUID for plane attributes.
|
||||
|
||||
Set (myclass ; label : Label from TDF)
|
||||
---Purpose: Finds or creates the plane attribute defined by
|
||||
-- the label label.
|
||||
-- Warning
|
||||
-- If you are creating the attribute with this syntax, a
|
||||
-- planar face should already be associated with label.
|
||||
returns Plane from TDataXtd;
|
||||
|
||||
Set (myclass ; label : Label from TDF; P : Pln from gp)
|
||||
---Purpose: Finds, or creates, a Plane attribute and sets <P> as
|
||||
-- generated the associated NamedShape.
|
||||
returns Plane from TDataXtd;
|
||||
|
||||
|
||||
---Purpose: Plane methods
|
||||
-- =============
|
||||
|
||||
Create
|
||||
returns Plane from TDataXtd;
|
||||
|
||||
---Category: TDF_Attribute methods
|
||||
-- =====================
|
||||
|
||||
ID (me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore (me: mutable; With : Attribute from TDF);
|
||||
|
||||
NewEmpty (me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; Into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
Dump (me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
end Plane;
|
||||
|
||||
|
@@ -13,28 +13,32 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Plane.ixx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <GeomLib_IsPlanarSurface.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDataXtd_Plane.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Plane::GetID ()
|
||||
{
|
||||
static Standard_GUID TDataXtd_PlaneID("2a96b60c-ec8b-11d0-bee7-080009dc3333");
|
||||
|
97
src/TDataXtd/TDataXtd_Plane.hxx
Normal file
97
src/TDataXtd/TDataXtd_Plane.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Plane_HeaderFile
|
||||
#define _TDataXtd_Plane_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class gp_Pln;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
class TDataXtd_Plane;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Plane, TDF_Attribute)
|
||||
|
||||
//! The basis to define a plane attribute.
|
||||
//! Warning: Use TDataXtd_Geometry attribute to retrieve the
|
||||
//! gp_Pln of the Plane attribute
|
||||
class TDataXtd_Plane : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! class methods
|
||||
//! =============
|
||||
//!
|
||||
//! Returns the GUID for plane attributes.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Finds or creates the plane attribute defined by
|
||||
//! the label label.
|
||||
//! Warning
|
||||
//! If you are creating the attribute with this syntax, a
|
||||
//! planar face should already be associated with label.
|
||||
Standard_EXPORT static Handle(TDataXtd_Plane) Set (const TDF_Label& label);
|
||||
|
||||
//! Finds, or creates, a Plane attribute and sets <P> as
|
||||
//! generated the associated NamedShape.
|
||||
//! Plane methods
|
||||
//! =============
|
||||
Standard_EXPORT static Handle(TDataXtd_Plane) Set (const TDF_Label& label, const gp_Pln& P);
|
||||
|
||||
Standard_EXPORT TDataXtd_Plane();
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Plane,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Plane_HeaderFile
|
@@ -1,85 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Point from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose:
|
||||
-- The basis to define a point attribute.
|
||||
-- The topological attribute must contain a vertex.
|
||||
-- You use this class to create reference points in a design.
|
||||
--
|
||||
-- Warning: Use TDataXtd_Geometry attribute to retrieve the
|
||||
-- gp_Pnt of the Point attribute
|
||||
|
||||
uses Attribute from TDF,
|
||||
Label from TDF,
|
||||
GUID from Standard,
|
||||
Pnt from gp,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF
|
||||
|
||||
is
|
||||
|
||||
|
||||
---Purpose: class methods
|
||||
-- =============
|
||||
|
||||
GetID(myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
---Purpose:
|
||||
-- Returns the GUID for point attributes.
|
||||
|
||||
Set (myclass ; label : Label from TDF)
|
||||
---Purpose:
|
||||
-- Sets the label Label as a point attribute.
|
||||
-- If no object is found, a point attribute is created.
|
||||
returns Point from TDataXtd;
|
||||
|
||||
Set (myclass ; label : Label from TDF; P : Pnt from gp)
|
||||
---Purpose:
|
||||
-- Sets the label Label as a point attribute containing the point P.
|
||||
-- If no object is found, a point attribute is created.
|
||||
returns Point from TDataXtd;
|
||||
|
||||
---Purpose: Point methods
|
||||
-- =============
|
||||
|
||||
Create
|
||||
returns Point from TDataXtd;
|
||||
|
||||
---Category: TDF_Attribute methods
|
||||
-- =====================
|
||||
|
||||
|
||||
ID (me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore (me: mutable; With : Attribute from TDF);
|
||||
|
||||
NewEmpty (me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; Into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
Dump (me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
end Point;
|
||||
|
@@ -13,27 +13,30 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Point.ixx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDataXtd_Point.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TDataXtd_Point::GetID()
|
||||
{
|
||||
static Standard_GUID TDataXtd_PointID("2a96b60d-ec8b-11d0-bee7-080009dc3333");
|
||||
|
100
src/TDataXtd/TDataXtd_Point.hxx
Normal file
100
src/TDataXtd/TDataXtd_Point.hxx
Normal file
@@ -0,0 +1,100 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Point_HeaderFile
|
||||
#define _TDataXtd_Point_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class gp_Pnt;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
class TDataXtd_Point;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Point, TDF_Attribute)
|
||||
|
||||
|
||||
//! The basis to define a point attribute.
|
||||
//! The topological attribute must contain a vertex.
|
||||
//! You use this class to create reference points in a design.
|
||||
//!
|
||||
//! Warning: Use TDataXtd_Geometry attribute to retrieve the
|
||||
//! gp_Pnt of the Point attribute
|
||||
class TDataXtd_Point : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! class methods
|
||||
//! =============
|
||||
//!
|
||||
//! Returns the GUID for point attributes.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
|
||||
//! Sets the label Label as a point attribute.
|
||||
//! If no object is found, a point attribute is created.
|
||||
Standard_EXPORT static Handle(TDataXtd_Point) Set (const TDF_Label& label);
|
||||
|
||||
|
||||
//! Sets the label Label as a point attribute containing the point P.
|
||||
//! If no object is found, a point attribute is created.
|
||||
//! Point methods
|
||||
//! =============
|
||||
Standard_EXPORT static Handle(TDataXtd_Point) Set (const TDF_Label& label, const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT TDataXtd_Point();
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Point,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Point_HeaderFile
|
@@ -1,97 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Position from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose: Position of a Label
|
||||
|
||||
uses
|
||||
RelocationTable from TDF,
|
||||
GUID from Standard,
|
||||
Attribute from TDF,
|
||||
Pnt from gp,
|
||||
Label from TDF
|
||||
|
||||
|
||||
|
||||
is
|
||||
|
||||
Set(myclass; aLabel: Label from TDF; aPos : Pnt from gp);
|
||||
---Purpose: Create if not found the TDataXtd_Position attribute set its position to <aPos>
|
||||
|
||||
Set (myclass; aLabel : Label from TDF)
|
||||
---Purpose: Find an existing, or create an empty, Position.
|
||||
-- the Position attribute is returned.
|
||||
returns Position from TDataXtd;
|
||||
|
||||
Get(myclass; aLabel: Label from TDF; aPos : in out Pnt from gp)
|
||||
---Purpose: Search label <aLabel) for the TDataXtd_Position attribute and get its position
|
||||
-- if found returns True
|
||||
returns Boolean from Standard;
|
||||
|
||||
Create
|
||||
returns Position from TDataXtd;
|
||||
|
||||
ID(me) returns GUID from Standard
|
||||
is redefined static;
|
||||
---Purpose: Returns the ID of the attribute.
|
||||
---C++: return const &
|
||||
|
||||
GetID(myclass) returns GUID from Standard;
|
||||
---Purpose: Returns the ID of the attribute.
|
||||
---C++: return const &
|
||||
|
||||
|
||||
Restore(me: mutable; anAttribute : Attribute from TDF)
|
||||
is redefined;
|
||||
---Purpose: Restores the contents from <anAttribute> into this
|
||||
-- one. It is used when aborting a transaction.
|
||||
--
|
||||
|
||||
-- Copy use methods
|
||||
-- ----------------
|
||||
|
||||
NewEmpty(me)
|
||||
returns Attribute from TDF
|
||||
is redefined;
|
||||
---Purpose: Returns an new empty attribute from the good end
|
||||
-- type. It is used by the copy algorithm.
|
||||
|
||||
Paste(me; intoAttribute : Attribute from TDF;
|
||||
aRelocTationable : RelocationTable from TDF)
|
||||
is redefined;
|
||||
---Purpose: This method is different from the "Copy" one,
|
||||
-- because it is used when copying an attribute from
|
||||
-- a source structure into a target structure. This
|
||||
-- method pastes the current attribute to the label
|
||||
-- corresponding to the insertor. The pasted
|
||||
-- attribute may be a brand new one or a new version
|
||||
-- of the previous one.
|
||||
|
||||
|
||||
GetPosition (me)
|
||||
---C++: return const &
|
||||
returns Pnt from gp;
|
||||
|
||||
SetPosition (me: mutable ; aPos : Pnt from gp);
|
||||
|
||||
fields
|
||||
|
||||
myPosition : Pnt from gp;
|
||||
|
||||
end Position;
|
||||
|
||||
|
||||
|
@@ -13,8 +13,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Position.ixx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Set (class method)
|
||||
|
106
src/TDataXtd/TDataXtd_Position.hxx
Normal file
106
src/TDataXtd/TDataXtd_Position.hxx
Normal file
@@ -0,0 +1,106 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Position_HeaderFile
|
||||
#define _TDataXtd_Position_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TDF_Label;
|
||||
class gp_Pnt;
|
||||
class Standard_GUID;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
class TDataXtd_Position;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Position, TDF_Attribute)
|
||||
|
||||
//! Position of a Label
|
||||
class TDataXtd_Position : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Create if not found the TDataXtd_Position attribute set its position to <aPos>
|
||||
Standard_EXPORT static void Set (const TDF_Label& aLabel, const gp_Pnt& aPos);
|
||||
|
||||
//! Find an existing, or create an empty, Position.
|
||||
//! the Position attribute is returned.
|
||||
Standard_EXPORT static Handle(TDataXtd_Position) Set (const TDF_Label& aLabel);
|
||||
|
||||
//! Search label <aLabel) for the TDataXtd_Position attribute and get its position
|
||||
//! if found returns True
|
||||
Standard_EXPORT static Standard_Boolean Get (const TDF_Label& aLabel, gp_Pnt& aPos);
|
||||
|
||||
Standard_EXPORT TDataXtd_Position();
|
||||
|
||||
//! Returns the ID of the attribute.
|
||||
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the ID of the attribute.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Restores the contents from <anAttribute> into this
|
||||
//! one. It is used when aborting a transaction.
|
||||
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
|
||||
|
||||
//! Returns an new empty attribute from the good end
|
||||
//! type. It is used by the copy algorithm.
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
|
||||
|
||||
//! This method is different from the "Copy" one,
|
||||
//! because it is used when copying an attribute from
|
||||
//! a source structure into a target structure. This
|
||||
//! method pastes the current attribute to the label
|
||||
//! corresponding to the insertor. The pasted
|
||||
//! attribute may be a brand new one or a new version
|
||||
//! of the previous one.
|
||||
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT const gp_Pnt& GetPosition() const;
|
||||
|
||||
Standard_EXPORT void SetPosition (const gp_Pnt& aPos);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Position,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
gp_Pnt myPosition;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Position_HeaderFile
|
@@ -1,91 +0,0 @@
|
||||
-- Created on: 2009-04-06
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Shape from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose: A Shape is associated in the framework with :
|
||||
-- a NamedShape attribute
|
||||
|
||||
|
||||
uses Attribute from TDF,
|
||||
Label from TDF,
|
||||
NamedShape from TNaming,
|
||||
GUID from Standard,
|
||||
DataSet from TDF,
|
||||
RelocationTable from TDF,
|
||||
Shape from TopoDS
|
||||
is
|
||||
|
||||
|
||||
---Purpose: class methods
|
||||
-- =============
|
||||
|
||||
Find (myclass; current : Label from TDF; S : in out Shape from TDataXtd)
|
||||
---Purpose: try to retrieve a Shape attribute at <current> label
|
||||
-- or in fathers label of <current>. Returns True if
|
||||
-- found and set <S>.
|
||||
returns Boolean from Standard;
|
||||
|
||||
New (myclass; label : Label from TDF)
|
||||
---Purpose: Find, or create, a Shape attribute. the Shape attribute
|
||||
-- is returned. Raises if <label> has attribute.
|
||||
returns Shape from TDataXtd;
|
||||
|
||||
Set (myclass; label : Label from TDF; shape : Shape from TopoDS)
|
||||
---Purpose: Create or update associated NamedShape attribute. the
|
||||
-- Shape attribute is returned.
|
||||
returns Shape from TDataXtd;
|
||||
|
||||
Get (myclass; label : Label from TDF)
|
||||
---Purpose: the Shape from associated NamedShape attribute
|
||||
-- is returned.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
GetID (myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
---Purpose: Shape methods
|
||||
-- ============
|
||||
|
||||
Create
|
||||
returns Shape from TDataXtd;
|
||||
|
||||
|
||||
---Category: methodes de TDF_Attribute
|
||||
-- =========================
|
||||
|
||||
|
||||
ID (me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Restore (me: mutable; with : Attribute from TDF);
|
||||
|
||||
NewEmpty (me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Paste (me; into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
References (me; DS : DataSet from TDF) is redefined;
|
||||
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
end Shape;
|
||||
|
@@ -13,22 +13,28 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TDataXtd_Shape.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDataStd.hxx>
|
||||
#include <TDataXtd.hxx>
|
||||
#include <TDataXtd_Shape.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_DataSet.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Find
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean TDataXtd_Shape::Find (const TDF_Label& current,
|
||||
Handle(TDataXtd_Shape)& S)
|
||||
{
|
||||
|
104
src/TDataXtd/TDataXtd_Shape.hxx
Normal file
104
src/TDataXtd/TDataXtd_Shape.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 2009-04-06
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2009-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _TDataXtd_Shape_HeaderFile
|
||||
#define _TDataXtd_Shape_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
class Standard_GUID;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_DataSet;
|
||||
|
||||
|
||||
class TDataXtd_Shape;
|
||||
DEFINE_STANDARD_HANDLE(TDataXtd_Shape, TDF_Attribute)
|
||||
|
||||
//! A Shape is associated in the framework with :
|
||||
//! a NamedShape attribute
|
||||
class TDataXtd_Shape : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! class methods
|
||||
//! =============
|
||||
//! try to retrieve a Shape attribute at <current> label
|
||||
//! or in fathers label of <current>. Returns True if
|
||||
//! found and set <S>.
|
||||
Standard_EXPORT static Standard_Boolean Find (const TDF_Label& current, Handle(TDataXtd_Shape)& S);
|
||||
|
||||
//! Find, or create, a Shape attribute. the Shape attribute
|
||||
//! is returned. Raises if <label> has attribute.
|
||||
Standard_EXPORT static Handle(TDataXtd_Shape) New (const TDF_Label& label);
|
||||
|
||||
//! Create or update associated NamedShape attribute. the
|
||||
//! Shape attribute is returned.
|
||||
Standard_EXPORT static Handle(TDataXtd_Shape) Set (const TDF_Label& label, const TopoDS_Shape& shape);
|
||||
|
||||
//! the Shape from associated NamedShape attribute
|
||||
//! is returned.
|
||||
Standard_EXPORT static TopoDS_Shape Get (const TDF_Label& label);
|
||||
|
||||
//! Shape methods
|
||||
//! ============
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
Standard_EXPORT TDataXtd_Shape();
|
||||
|
||||
Standard_EXPORT const Standard_GUID& ID() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with);
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& DS) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TDataXtd_Shape,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TDataXtd_Shape_HeaderFile
|
Reference in New Issue
Block a user