1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,5 +1,29 @@
EXTERNLIB
STEPConstruct_DataMapOfAsciiStringTransient.hxx
STEPConstruct.cxx
STEPConstruct.hxx
STEPConstruct_AP203Context.cxx
STEPConstruct_AP203Context.hxx
STEPConstruct_Assembly.cxx
STEPConstruct_Assembly.hxx
STEPConstruct_ContextTool.cxx
STEPConstruct_ContextTool.hxx
STEPConstruct_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx
STEPConstruct_DataMapOfPointTransient.hxx
STEPConstruct_DataMapIteratorOfDataMapOfPointTransient.hxx
STEPConstruct_DataMapOfAsciiStringTransient.hxx
STEPConstruct_DataMapOfPointTransient.hxx
STEPConstruct_ExternRefs.cxx
STEPConstruct_ExternRefs.hxx
STEPConstruct_Part.cxx
STEPConstruct_Part.hxx
STEPConstruct_PointHasher.cxx
STEPConstruct_PointHasher.hxx
STEPConstruct_PointHasher.lxx
STEPConstruct_Styles.cxx
STEPConstruct_Styles.hxx
STEPConstruct_Tool.cxx
STEPConstruct_Tool.hxx
STEPConstruct_Tool.lxx
STEPConstruct_UnitContext.cxx
STEPConstruct_UnitContext.hxx
STEPConstruct_ValidationProps.cxx
STEPConstruct_ValidationProps.hxx

View File

@@ -1,100 +0,0 @@
-- Created on: 1999-11-17
-- Created by: Andrey BETENEV
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package STEPConstruct
---Purpose: Defines tools for creation and investigation STEP constructs
-- used for representing various kinds of data, such as product and
-- assembly structure, unit contexts, associated information
-- The creation of these structures is made according to currently
-- active schema (AP203 or AP214 CD2 or DIS)
-- This is taken from parameter write.step.schema
uses
gp,
Quantity,
TCollection,
TColStd,
TopTools,
TopLoc,
TopoDS,
Interface,
Transfer,
XSControl,
StepData,
StepBasic,
StepGeom,
StepRepr,
StepShape,
StepVisual,
StepAP203,
StepAP214
is
class Tool;
class UnitContext;
class Part;
class Assembly;
class Styles;
class ValidationProps;
class ExternRefs;
class AP203Context;
class ContextTool;
--- skl 15.01.2004
imported DataMapOfAsciiStringTransient;
imported DataMapIteratorOfDataMapOfAsciiStringTransient;
class PointHasher;
imported DataMapOfPointTransient;
imported DataMapIteratorOfDataMapOfPointTransient;
FindEntity (FinderProcess: FinderProcess from Transfer; Shape: Shape from TopoDS)
returns RepresentationItem from StepRepr;
---Purpose: Returns STEP entity of the (sub)type of RepresentationItem
-- which is a result of the tranalation of the Shape, or Null if
-- no result is recorded
FindEntity (FinderProcess: FinderProcess from Transfer; Shape: Shape from TopoDS;
Loc: out Location from TopLoc)
returns RepresentationItem from StepRepr;
---Purpose: The same as above, but in the case if item not found, repeats
-- search on the same shape without location. The Loc corresponds to the
-- location with which result is found (either location of the Shape,
-- or Null)
FindShape (TransientProcess: TransientProcess from Transfer; item: RepresentationItem from StepRepr)
returns Shape from TopoDS;
---Purpose: Returns Shape resulting from given STEP entity (Null if not mapped)
FindCDSR (ComponentBinder: Binder from Transfer;
AssemblySDR: ShapeDefinitionRepresentation from StepShape;
ComponentCDSR: out ContextDependentShapeRepresentation from StepShape)
returns Boolean from Standard;
---Purpose: Find CDSR correcponding to the component in the specified assembly
end STEPConstruct;

View File

@@ -13,24 +13,28 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct.ixx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionRelationship.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <STEPConstruct.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransientProcess.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
//=======================================================================
//function : FindEntity
//purpose :
//=======================================================================
Handle(StepRepr_RepresentationItem) STEPConstruct::FindEntity (const Handle(Transfer_FinderProcess) &FinderProcess,
const TopoDS_Shape &Shape)
{

View File

@@ -0,0 +1,108 @@
// Created on: 1999-11-17
// Created by: Andrey BETENEV
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_HeaderFile
#define _STEPConstruct_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
class StepRepr_RepresentationItem;
class Transfer_FinderProcess;
class TopoDS_Shape;
class TopLoc_Location;
class Transfer_TransientProcess;
class Transfer_Binder;
class StepShape_ShapeDefinitionRepresentation;
class StepShape_ContextDependentShapeRepresentation;
class STEPConstruct_Tool;
class STEPConstruct_UnitContext;
class STEPConstruct_Part;
class STEPConstruct_Assembly;
class STEPConstruct_Styles;
class STEPConstruct_ValidationProps;
class STEPConstruct_ExternRefs;
class STEPConstruct_AP203Context;
class STEPConstruct_ContextTool;
class STEPConstruct_PointHasher;
//! Defines tools for creation and investigation STEP constructs
//! used for representing various kinds of data, such as product and
//! assembly structure, unit contexts, associated information
//! The creation of these structures is made according to currently
//! active schema (AP203 or AP214 CD2 or DIS)
//! This is taken from parameter write.step.schema
class STEPConstruct
{
public:
DEFINE_STANDARD_ALLOC
//! Returns STEP entity of the (sub)type of RepresentationItem
//! which is a result of the tranalation of the Shape, or Null if
//! no result is recorded
Standard_EXPORT static Handle(StepRepr_RepresentationItem) FindEntity (const Handle(Transfer_FinderProcess)& FinderProcess, const TopoDS_Shape& Shape);
//! The same as above, but in the case if item not found, repeats
//! search on the same shape without location. The Loc corresponds to the
//! location with which result is found (either location of the Shape,
//! or Null)
Standard_EXPORT static Handle(StepRepr_RepresentationItem) FindEntity (const Handle(Transfer_FinderProcess)& FinderProcess, const TopoDS_Shape& Shape, TopLoc_Location& Loc);
//! Returns Shape resulting from given STEP entity (Null if not mapped)
Standard_EXPORT static TopoDS_Shape FindShape (const Handle(Transfer_TransientProcess)& TransientProcess, const Handle(StepRepr_RepresentationItem)& item);
//! Find CDSR correcponding to the component in the specified assembly
Standard_EXPORT static Standard_Boolean FindCDSR (const Handle(Transfer_Binder)& ComponentBinder, const Handle(StepShape_ShapeDefinitionRepresentation)& AssemblySDR, Handle(StepShape_ContextDependentShapeRepresentation)& ComponentCDSR);
protected:
private:
friend class STEPConstruct_Tool;
friend class STEPConstruct_UnitContext;
friend class STEPConstruct_Part;
friend class STEPConstruct_Assembly;
friend class STEPConstruct_Styles;
friend class STEPConstruct_ValidationProps;
friend class STEPConstruct_ExternRefs;
friend class STEPConstruct_AP203Context;
friend class STEPConstruct_ContextTool;
friend class STEPConstruct_PointHasher;
};
#endif // _STEPConstruct_HeaderFile

View File

@@ -1,189 +0,0 @@
-- Created on: 1999-11-18
-- Created by: Andrey BETENEV
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class AP203Context from STEPConstruct
---Purpose: Maintains context specific for AP203 (required data and
-- management information such as persons, dates, approvals etc.)
-- It contains static entities (which can be shared), default
-- values for person and organisation, and also provides
-- tool for creating management entities around specific part (SDR).
uses
Approval from StepBasic,
DateAndTime from StepBasic,
PersonAndOrganization from StepBasic,
SecurityClassificationLevel from StepBasic,
PersonAndOrganizationRole from StepBasic,
DateTimeRole from StepBasic,
ApprovalRole from StepBasic,
CcDesignPersonAndOrganizationAssignment from StepAP203,
CcDesignSecurityClassification from StepAP203,
CcDesignDateAndTimeAssignment from StepAP203,
CcDesignApproval from StepAP203,
ApprovalPersonOrganization from StepBasic,
ApprovalDateTime from StepBasic,
ShapeDefinitionRepresentation from StepShape,
NextAssemblyUsageOccurrence from StepRepr,
ProductCategoryRelationship from StepBasic,
Part from STEPConstruct
is
Create returns AP203Context from STEPConstruct;
---Purpose: Creates tool and fills constant fields
--- Entities shared by others by default
DefaultApproval (me: in out) returns Approval from StepBasic;
---Purpose: Returns default approval entity which
-- is used when no other data are available
SetDefaultApproval (me: in out; app: Approval from StepBasic);
---Purpose: Sets default approval
DefaultDateAndTime (me: in out) returns DateAndTime from StepBasic;
---Purpose: Returns default date_and_time entity which
-- is used when no other data are available
SetDefaultDateAndTime (me: in out; dt: DateAndTime from StepBasic);
---Purpose: Sets default date_and_time entity
DefaultPersonAndOrganization (me: in out) returns PersonAndOrganization from StepBasic;
---Purpose: Returns default person_and_organization entity which
-- is used when no other data are available
SetDefaultPersonAndOrganization (me: in out; po: PersonAndOrganization from StepBasic);
---Purpose: Sets default person_and_organization entity
DefaultSecurityClassificationLevel (me: in out) returns SecurityClassificationLevel from StepBasic;
---Purpose: Returns default security_classification_level entity which
-- is used when no other data are available
SetDefaultSecurityClassificationLevel (me: in out; sc: SecurityClassificationLevel from StepBasic);
---Purpose: Sets default security_classification_level
RoleCreator (me) returns PersonAndOrganizationRole from StepBasic;
RoleDesignOwner (me) returns PersonAndOrganizationRole from StepBasic;
RoleDesignSupplier (me) returns PersonAndOrganizationRole from StepBasic;
RoleClassificationOfficer (me) returns PersonAndOrganizationRole from StepBasic;
RoleCreationDate (me) returns DateTimeRole from StepBasic;
RoleClassificationDate (me) returns DateTimeRole from StepBasic;
RoleApprover (me) returns ApprovalRole from StepBasic;
---Purpose: Return predefined PersonAndOrganizationRole and DateTimeRole
-- entities named 'creator', 'design owner', 'design supplier',
-- 'classification officer', 'creation date', 'classification date',
-- 'approver'
--- Entities instantiated for each part
Init (me: in out; sdr: ShapeDefinitionRepresentation from StepShape);
---Purpose: Takes SDR (part) which brings all standard data around part
-- (common for AP203 and AP214) and creates all the additional
-- entities required for AP203
Init (me: in out; SDRTool: Part from STEPConstruct);
---Purpose: Takes tool which describes standard data around part
-- (common for AP203 and AP214) and creates all the additional
-- entities required for AP203
--
-- The created entities can be obtained by calls to methods
-- GetCreator(), GetDesignOwner(), GetDesignSupplier(),
-- GetClassificationOfficer(), GetSecurity(), GetCreationDate(),
-- GetClassificationDate(), GetApproval(),
-- GetApprover(), GetApprovalDateTime(),
-- GetProductCategoryRelationship()
Init (me: in out; nauo: NextAssemblyUsageOccurrence from StepRepr);
---Purpose: Takes NAUO which describes assembly link to component
-- and creates the security_classification entity associated to
-- it as required by the AP203
--
-- Instantiated (or existing previously) entities concerned
-- can be obtained by calls to methods
-- GetClassificationOfficer(), GetSecurity(),
-- GetClassificationDate(), GetApproval(),
-- GetApprover(), GetApprovalDateTime()
-- Init (me: in out; SDRTool: Part from STEPConstruct;
-- Model: InterfaceModel from Interface);
---Purpose: Takes tool which describes standard data around part
-- (common for AP203 and AP214) and takes from model (or creates
-- if missing) all the additional entities required by AP203
GetCreator (me) returns CcDesignPersonAndOrganizationAssignment from StepAP203;
GetDesignOwner (me) returns CcDesignPersonAndOrganizationAssignment from StepAP203;
GetDesignSupplier (me) returns CcDesignPersonAndOrganizationAssignment from StepAP203;
GetClassificationOfficer (me) returns CcDesignPersonAndOrganizationAssignment from StepAP203;
GetSecurity (me) returns CcDesignSecurityClassification from StepAP203;
GetCreationDate (me) returns CcDesignDateAndTimeAssignment from StepAP203;
GetClassificationDate (me) returns CcDesignDateAndTimeAssignment from StepAP203;
GetApproval (me) returns CcDesignApproval from StepAP203;
GetApprover (me) returns ApprovalPersonOrganization from StepBasic;
GetApprovalDateTime (me) returns ApprovalDateTime from StepBasic;
GetProductCategoryRelationship (me) returns ProductCategoryRelationship from StepBasic;
---Purpose: Return entities (roots) instantiated for the part by method Init
--- Advanced (rather internal) methods
Clear (me: in out);
---Purpose: Clears all fields describing entities specific to each part
InitRoles (me: in out);
---Purpose: Initializes constant fields (shared entities)
InitPart (me: in out; SDRTool: Part from STEPConstruct) is private;
---Purpose: Initializes all missing data which are required for part
InitAssembly (me: in out; nauo: NextAssemblyUsageOccurrence from StepRepr);
---Purpose: Initializes all missing data which are required for assembly
InitSecurityRequisites (me: in out);
---Purpose: Initializes ClassificationOfficer and ClassificationDate
-- entities according to Security entity
InitApprovalRequisites (me: in out);
---Purpose: Initializes Approver and ApprovalDateTime
-- entities according to Approval entity
fields
-- default values (to be replaced by some meaningful externally)
defApproval : Approval from StepBasic;
defDateAndTime : DateAndTime from StepBasic;
defPersonAndOrganization : PersonAndOrganization from StepBasic;
defSecurityClassificationLevel: SecurityClassificationLevel from StepBasic;
-- predefined roles
roleCreator : PersonAndOrganizationRole from StepBasic;
roleDesignOwner : PersonAndOrganizationRole from StepBasic;
roleDesignSupplier : PersonAndOrganizationRole from StepBasic;
roleClassificationOfficer: PersonAndOrganizationRole from StepBasic;
roleCreationDate : DateTimeRole from StepBasic;
roleClassificationDate : DateTimeRole from StepBasic;
roleApprover : ApprovalRole from StepBasic;
-- entities created for each part (roots)
myCreator : CcDesignPersonAndOrganizationAssignment from StepAP203;
myDesignOwner : CcDesignPersonAndOrganizationAssignment from StepAP203;
myDesignSupplier : CcDesignPersonAndOrganizationAssignment from StepAP203;
myClassificationOfficer : CcDesignPersonAndOrganizationAssignment from StepAP203;
mySecurity : CcDesignSecurityClassification from StepAP203;
myCreationDate : CcDesignDateAndTimeAssignment from StepAP203;
myClassificationDate : CcDesignDateAndTimeAssignment from StepAP203;
myApproval : CcDesignApproval from StepAP203;
myApprover : ApprovalPersonOrganization from StepBasic;
myApprovalDateTime : ApprovalDateTime from StepBasic;
myProductCategoryRelationship: ProductCategoryRelationship from StepBasic;
end AP203Context;

View File

@@ -14,7 +14,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_AP203Context.ixx>
#include <StepAP203_CcDesignApproval.hxx>
#include <StepAP203_CcDesignDateAndTimeAssignment.hxx>
#include <StepAP203_CcDesignPersonAndOrganizationAssignment.hxx>
#include <StepAP203_CcDesignSecurityClassification.hxx>
#include <StepBasic_Approval.hxx>
#include <StepBasic_ApprovalDateTime.hxx>
#include <StepBasic_ApprovalPersonOrganization.hxx>
#include <StepBasic_ApprovalRole.hxx>
#include <StepBasic_DateAndTime.hxx>
#include <StepBasic_DateTimeRole.hxx>
#include <StepBasic_PersonAndOrganization.hxx>
#include <StepBasic_PersonAndOrganizationRole.hxx>
#include <StepBasic_ProductCategoryRelationship.hxx>
#include <StepBasic_SecurityClassificationLevel.hxx>
#include <STEPConstruct_AP203Context.hxx>
#include <STEPConstruct_Part.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#ifndef _WIN32
# include <pwd.h>

View File

@@ -0,0 +1,223 @@
// Created on: 1999-11-18
// Created by: Andrey BETENEV
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_AP203Context_HeaderFile
#define _STEPConstruct_AP203Context_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class StepBasic_Approval;
class StepBasic_DateAndTime;
class StepBasic_PersonAndOrganization;
class StepBasic_SecurityClassificationLevel;
class StepBasic_PersonAndOrganizationRole;
class StepBasic_DateTimeRole;
class StepBasic_ApprovalRole;
class StepAP203_CcDesignPersonAndOrganizationAssignment;
class StepAP203_CcDesignSecurityClassification;
class StepAP203_CcDesignDateAndTimeAssignment;
class StepAP203_CcDesignApproval;
class StepBasic_ApprovalPersonOrganization;
class StepBasic_ApprovalDateTime;
class StepBasic_ProductCategoryRelationship;
class StepShape_ShapeDefinitionRepresentation;
class STEPConstruct_Part;
class StepRepr_NextAssemblyUsageOccurrence;
//! Maintains context specific for AP203 (required data and
//! management information such as persons, dates, approvals etc.)
//! It contains static entities (which can be shared), default
//! values for person and organisation, and also provides
//! tool for creating management entities around specific part (SDR).
class STEPConstruct_AP203Context
{
public:
DEFINE_STANDARD_ALLOC
//! Creates tool and fills constant fields
Standard_EXPORT STEPConstruct_AP203Context();
//! Returns default approval entity which
//! is used when no other data are available
Standard_EXPORT Handle(StepBasic_Approval) DefaultApproval();
//! Sets default approval
Standard_EXPORT void SetDefaultApproval (const Handle(StepBasic_Approval)& app);
//! Returns default date_and_time entity which
//! is used when no other data are available
Standard_EXPORT Handle(StepBasic_DateAndTime) DefaultDateAndTime();
//! Sets default date_and_time entity
Standard_EXPORT void SetDefaultDateAndTime (const Handle(StepBasic_DateAndTime)& dt);
//! Returns default person_and_organization entity which
//! is used when no other data are available
Standard_EXPORT Handle(StepBasic_PersonAndOrganization) DefaultPersonAndOrganization();
//! Sets default person_and_organization entity
Standard_EXPORT void SetDefaultPersonAndOrganization (const Handle(StepBasic_PersonAndOrganization)& po);
//! Returns default security_classification_level entity which
//! is used when no other data are available
Standard_EXPORT Handle(StepBasic_SecurityClassificationLevel) DefaultSecurityClassificationLevel();
//! Sets default security_classification_level
Standard_EXPORT void SetDefaultSecurityClassificationLevel (const Handle(StepBasic_SecurityClassificationLevel)& sc);
Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleCreator() const;
Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleDesignOwner() const;
Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleDesignSupplier() const;
Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleClassificationOfficer() const;
Standard_EXPORT Handle(StepBasic_DateTimeRole) RoleCreationDate() const;
Standard_EXPORT Handle(StepBasic_DateTimeRole) RoleClassificationDate() const;
//! Return predefined PersonAndOrganizationRole and DateTimeRole
//! entities named 'creator', 'design owner', 'design supplier',
//! 'classification officer', 'creation date', 'classification date',
//! 'approver'
Standard_EXPORT Handle(StepBasic_ApprovalRole) RoleApprover() const;
//! Takes SDR (part) which brings all standard data around part
//! (common for AP203 and AP214) and creates all the additional
//! entities required for AP203
Standard_EXPORT void Init (const Handle(StepShape_ShapeDefinitionRepresentation)& sdr);
//! Takes tool which describes standard data around part
//! (common for AP203 and AP214) and creates all the additional
//! entities required for AP203
//!
//! The created entities can be obtained by calls to methods
//! GetCreator(), GetDesignOwner(), GetDesignSupplier(),
//! GetClassificationOfficer(), GetSecurity(), GetCreationDate(),
//! GetClassificationDate(), GetApproval(),
//! GetApprover(), GetApprovalDateTime(),
//! GetProductCategoryRelationship()
Standard_EXPORT void Init (const STEPConstruct_Part& SDRTool);
//! Takes NAUO which describes assembly link to component
//! and creates the security_classification entity associated to
//! it as required by the AP203
//!
//! Instantiated (or existing previously) entities concerned
//! can be obtained by calls to methods
//! GetClassificationOfficer(), GetSecurity(),
//! GetClassificationDate(), GetApproval(),
//! GetApprover(), GetApprovalDateTime()
//! Takes tool which describes standard data around part
//! (common for AP203 and AP214) and takes from model (or creates
//! if missing) all the additional entities required by AP203
Standard_EXPORT void Init (const Handle(StepRepr_NextAssemblyUsageOccurrence)& nauo);
Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetCreator() const;
Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetDesignOwner() const;
Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetDesignSupplier() const;
Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetClassificationOfficer() const;
Standard_EXPORT Handle(StepAP203_CcDesignSecurityClassification) GetSecurity() const;
Standard_EXPORT Handle(StepAP203_CcDesignDateAndTimeAssignment) GetCreationDate() const;
Standard_EXPORT Handle(StepAP203_CcDesignDateAndTimeAssignment) GetClassificationDate() const;
Standard_EXPORT Handle(StepAP203_CcDesignApproval) GetApproval() const;
Standard_EXPORT Handle(StepBasic_ApprovalPersonOrganization) GetApprover() const;
Standard_EXPORT Handle(StepBasic_ApprovalDateTime) GetApprovalDateTime() const;
//! Return entities (roots) instantiated for the part by method Init
Standard_EXPORT Handle(StepBasic_ProductCategoryRelationship) GetProductCategoryRelationship() const;
//! Clears all fields describing entities specific to each part
Standard_EXPORT void Clear();
//! Initializes constant fields (shared entities)
Standard_EXPORT void InitRoles();
//! Initializes all missing data which are required for assembly
Standard_EXPORT void InitAssembly (const Handle(StepRepr_NextAssemblyUsageOccurrence)& nauo);
//! Initializes ClassificationOfficer and ClassificationDate
//! entities according to Security entity
Standard_EXPORT void InitSecurityRequisites();
//! Initializes Approver and ApprovalDateTime
//! entities according to Approval entity
Standard_EXPORT void InitApprovalRequisites();
protected:
private:
//! Initializes all missing data which are required for part
Standard_EXPORT void InitPart (const STEPConstruct_Part& SDRTool);
Handle(StepBasic_Approval) defApproval;
Handle(StepBasic_DateAndTime) defDateAndTime;
Handle(StepBasic_PersonAndOrganization) defPersonAndOrganization;
Handle(StepBasic_SecurityClassificationLevel) defSecurityClassificationLevel;
Handle(StepBasic_PersonAndOrganizationRole) roleCreator;
Handle(StepBasic_PersonAndOrganizationRole) roleDesignOwner;
Handle(StepBasic_PersonAndOrganizationRole) roleDesignSupplier;
Handle(StepBasic_PersonAndOrganizationRole) roleClassificationOfficer;
Handle(StepBasic_DateTimeRole) roleCreationDate;
Handle(StepBasic_DateTimeRole) roleClassificationDate;
Handle(StepBasic_ApprovalRole) roleApprover;
Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myCreator;
Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myDesignOwner;
Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myDesignSupplier;
Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myClassificationOfficer;
Handle(StepAP203_CcDesignSecurityClassification) mySecurity;
Handle(StepAP203_CcDesignDateAndTimeAssignment) myCreationDate;
Handle(StepAP203_CcDesignDateAndTimeAssignment) myClassificationDate;
Handle(StepAP203_CcDesignApproval) myApproval;
Handle(StepBasic_ApprovalPersonOrganization) myApprover;
Handle(StepBasic_ApprovalDateTime) myApprovalDateTime;
Handle(StepBasic_ProductCategoryRelationship) myProductCategoryRelationship;
};
#endif // _STEPConstruct_AP203Context_HeaderFile

View File

@@ -1,80 +0,0 @@
-- Created on: 1998-07-07
-- Created by: Christian CAILLET
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Assembly from STEPConstruct
---Purpose : This operator creates and checks an item of an assembly, from its
-- basic data : a ShapeRepresentation, a Location ...
--
-- Three ways of coding such item from a ShapeRepresentation :
-- - do nothing : i.e. informations for assembly are ignored
-- - create a MappedItem
-- - create a RepresentationRelationship (WithTransformation)
uses
Trsf from gp,
InterfaceModel from Interface,
Axis2Placement3d from StepGeom,
ShapeRepresentation from StepShape,
ShapeDefinitionRepresentation from StepShape,
NextAssemblyUsageOccurrence from StepRepr,
ContextDependentShapeRepresentation from StepShape
is
Create returns Assembly from STEPConstruct;
Init (me: in out; aSR, SDR0: ShapeDefinitionRepresentation from StepShape;
Ax0, Loc : Axis2Placement3d from StepGeom);
---Purpose : Initialises with starting values
-- Ax0 : origin axis (typically, standard XYZ)
-- Loc : location to which place the item
-- MakeMappedItem (me: in out);
---Purpose : Makes a MappedItem
-- Resulting Value is returned by ItemValue
MakeRelationship (me: in out);
---Purpose : Make a (ShapeRepresentationRelationship,...WithTransformation)
-- Resulting Value is returned by ItemValue
ItemValue (me) returns Transient;
---Purpose : Returns the Value
-- If no Make... has been called, returns the starting SR
ItemLocation (me) returns Axis2Placement3d from StepGeom;
---Purpose : Returns the location of the item, computed from starting aLoc
GetNAUO (me) returns NextAssemblyUsageOccurrence from StepRepr;
---Purpose: Returns NAUO object describing the assembly link
CheckSRRReversesNAUO (myclass; Model: InterfaceModel from Interface;
CDSR : ContextDependentShapeRepresentation from StepShape)
returns Boolean;
---Purpose: Checks whether SRR's definition of assembly and component contradicts
-- with NAUO definition or not, according to model schema (AP214 or AP203)
--
fields
thesdr : ShapeDefinitionRepresentation from StepShape;
thesdr0: ShapeDefinitionRepresentation from StepShape;
thesr : ShapeRepresentation from StepShape;
thesr0 : ShapeRepresentation from StepShape;
theval : Transient;
theloc : Axis2Placement3d from StepGeom;
theax0 : Axis2Placement3d from StepGeom;
end Assembly;

View File

@@ -14,41 +14,38 @@
//:k8 abv 06.01.99: TR10: writing unique names for NAUOs
// :j4 16.03.99 gka S4134
// abv 18.11.99 renamed from StepPDR_MakeItem
#include <STEPConstruct_Assembly.ixx>
#include <Interface_InterfaceModel.hxx>
#include <Standard_Transient.hxx>
#include <StepBasic_ApplicationContext.hxx>
#include <StepBasic_DesignContext.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_MechanicalContext.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionFormationWithSpecifiedSource.hxx>
#include <STEPConstruct_Assembly.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_ItemDefinedTransformation.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
#include <StepRepr_Transformation.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <TCollection_HAsciiString.hxx>
// ProductDefinition (pour Relationship)
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_DesignContext.hxx>
#include <StepBasic_ProductDefinitionFormationWithSpecifiedSource.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_MechanicalContext.hxx>
#include <StepBasic_ApplicationContext.hxx>
// ContextDependentShapeRepresentation qui contient la Relationship
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
// Relationship
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepRepr_ItemDefinedTransformation.hxx>
#include <StepRepr_Transformation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
//=======================================================================
//function : STEPConstruct_Assembly
//purpose :
//=======================================================================
STEPConstruct_Assembly::STEPConstruct_Assembly ()
{
}

View File

@@ -0,0 +1,105 @@
// Created on: 1998-07-07
// Created by: Christian CAILLET
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_Assembly_HeaderFile
#define _STEPConstruct_Assembly_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
class StepShape_ShapeDefinitionRepresentation;
class StepShape_ShapeRepresentation;
class Standard_Transient;
class StepGeom_Axis2Placement3d;
class StepRepr_NextAssemblyUsageOccurrence;
class Interface_InterfaceModel;
class StepShape_ContextDependentShapeRepresentation;
//! This operator creates and checks an item of an assembly, from its
//! basic data : a ShapeRepresentation, a Location ...
//!
//! Three ways of coding such item from a ShapeRepresentation :
//! - do nothing : i.e. informations for assembly are ignored
//! - create a MappedItem
//! - create a RepresentationRelationship (WithTransformation)
class STEPConstruct_Assembly
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT STEPConstruct_Assembly();
//! Initialises with starting values
//! Ax0 : origin axis (typically, standard XYZ)
//! Loc : location to which place the item
//! Makes a MappedItem
//! Resulting Value is returned by ItemValue
Standard_EXPORT void Init (const Handle(StepShape_ShapeDefinitionRepresentation)& aSR, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0, const Handle(StepGeom_Axis2Placement3d)& Ax0, const Handle(StepGeom_Axis2Placement3d)& Loc);
//! Make a (ShapeRepresentationRelationship,...WithTransformation)
//! Resulting Value is returned by ItemValue
Standard_EXPORT void MakeRelationship();
//! Returns the Value
//! If no Make... has been called, returns the starting SR
Standard_EXPORT Handle(Standard_Transient) ItemValue() const;
//! Returns the location of the item, computed from starting aLoc
Standard_EXPORT Handle(StepGeom_Axis2Placement3d) ItemLocation() const;
//! Returns NAUO object describing the assembly link
Standard_EXPORT Handle(StepRepr_NextAssemblyUsageOccurrence) GetNAUO() const;
//! Checks whether SRR's definition of assembly and component contradicts
//! with NAUO definition or not, according to model schema (AP214 or AP203)
Standard_EXPORT static Standard_Boolean CheckSRRReversesNAUO (const Handle(Interface_InterfaceModel)& Model, const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR);
protected:
private:
Handle(StepShape_ShapeDefinitionRepresentation) thesdr;
Handle(StepShape_ShapeDefinitionRepresentation) thesdr0;
Handle(StepShape_ShapeRepresentation) thesr;
Handle(StepShape_ShapeRepresentation) thesr0;
Handle(Standard_Transient) theval;
Handle(StepGeom_Axis2Placement3d) theloc;
Handle(StepGeom_Axis2Placement3d) theax0;
};
#endif // _STEPConstruct_Assembly_HeaderFile

View File

@@ -1,137 +0,0 @@
-- Created on: 1993-09-14
-- Created by: Frederic MAUPAS
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ContextTool from STEPConstruct
---Purpose : Maintains global context tool for writing.
-- Gives access to Product Definition Context (one per Model)
-- Maintains ApplicationProtocolDefinition entity (common for all
-- products)
-- Also maintains context specific for AP203 and provides set of
-- methods to work with various STEP constructs as required
-- by Actor
uses
SequenceOfInteger from TColStd,
HSequenceOfTransient from TColStd,
HAsciiString from TCollection,
StepModel from StepData,
ApplicationProtocolDefinition from StepBasic,
ShapeDefinitionRepresentation from StepShape,
Axis2Placement3d from StepGeom,
AP203Context from STEPConstruct,
Assembly from STEPConstruct,
Part from STEPConstruct
is
Create returns ContextTool from STEPConstruct;
Create (aStepModel : StepModel from StepData) returns ContextTool from STEPConstruct;
---Management of ApplicationProtocolDefinition
SetModel (me : in out; aStepModel : StepModel from StepData);
---Purpose: Initialize ApplicationProtocolDefinition by the first
-- entity of that type found in the model
GetAPD(me : in out) returns ApplicationProtocolDefinition from StepBasic;
---Purpose:
AddAPD(me : in out; enforce : Boolean = Standard_False);
IsAP203 (me) returns Boolean;
---Purpose: Returns True if APD.schema_name is config_control_design
IsAP214 (me) returns Boolean;
---Purpose: Returns True if APD.schema_name is automotive_design
-- AC : Application Context
GetACstatus(me : in out) returns HAsciiString from TCollection;
GetACschemaName(me : in out) returns HAsciiString from TCollection;
GetACyear(me : in out) returns Integer;
-- GetACapplication(me : in out)
-- returns HAsciiString from TCollection; via the SDR
GetACname (me : in out) returns HAsciiString from TCollection;
SetACstatus (me: in out; status: HAsciiString from TCollection);
SetACschemaName(me: in out; schemaName: HAsciiString from TCollection);
SetACyear (me: in out; year: Integer);
-- SetACapplication(me : in out;
-- application : HAsciiString from TCollection);
SetACname (me: in out; name : HAsciiString from TCollection);
-- Other context items
GetDefaultAxis (me: in out) returns Axis2Placement3d from StepGeom;
---Purpose: Returns a default axis placement
AP203Context (me: in out) returns AP203Context from STEPConstruct;
---Purpose: Returns tool which maintains context specific for AP203
---C++: return &
-- Management of assembly level for naming products
Level (me) returns Integer;
---Purpose: Returns current assembly level
NextLevel (me: in out);
PrevLevel (me: in out);
SetLevel (me: in out; lev: Integer );
---Purpose: Changes current assembly level
Index (me) returns Integer;
---Purpose: Returns current index of assembly component on current level
NextIndex (me: in out);
PrevIndex (me: in out);
SetIndex (me: in out; ind: Integer );
---Purpose: Changes current index of assembly component on current level
GetProductName (me) returns HAsciiString from TCollection;
---Purpose: Generates a product name basing on write.step.product.name
-- parameter and current position in the assembly structure
-- Methods for collecting all roots corresponding to some constructs
GetRootsForPart (me: in out; SDRTool: Part from STEPConstruct)
returns HSequenceOfTransient from TColStd;
---Purpose: Produces and returns a full list of root entities required
-- for part identified by SDRTool (including SDR itself)
GetRootsForAssemblyLink (me: in out; assembly: Assembly from STEPConstruct)
returns HSequenceOfTransient from TColStd;
---Purpose: Produces and returns a full list of root entities required
-- for assembly link identified by assembly (including NAUO and CDSR)
fields
myLevel : SequenceOfInteger from TColStd; -- level of assembly for auto naming products
theAPD : ApplicationProtocolDefinition from StepBasic;
theAP203 : AP203Context from STEPConstruct;
myAxis : Axis2Placement3d from StepGeom;
end ContextTool;

View File

@@ -16,42 +16,45 @@
// :j4 16.03.99 gka S4134
// abv 18.11.99 renamed from StepPDR_ContextTool
#include <STEPConstruct_ContextTool.ixx>
#include <StepData_StepModel.hxx>
#include <Interface_Macros.hxx>
#include <StepBasic_ProductDefinition.hxx>
//#include <StepBasic_ProductDefinitionContext.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductContext.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_ApplicationContext.hxx>
#include <StepBasic_ApplicationProtocolDefinition.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepBasic_HArray1OfProduct.hxx>
#include <StepBasic_ProductType.hxx> //:i3
#include <Interface_Static.hxx> //:j4
#include <GeomToStep_MakeAxis2Placement3d.hxx>
#include <StepBasic_ApprovalPersonOrganization.hxx>
#include <StepBasic_ApprovalDateTime.hxx>
#include <StepBasic_ProductRelatedProductCategory.hxx>
#include <StepBasic_ProductCategoryRelationship.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Static.hxx>
#include <StepAP203_CcDesignApproval.hxx>
#include <StepAP203_CcDesignDateAndTimeAssignment.hxx>
#include <StepAP203_CcDesignPersonAndOrganizationAssignment.hxx>
#include <StepAP203_CcDesignSecurityClassification.hxx>
#include <StepAP203_CcDesignDateAndTimeAssignment.hxx>
#include <StepAP203_CcDesignApproval.hxx>
#include <StepBasic_ApplicationContext.hxx>
#include <StepBasic_ApplicationProtocolDefinition.hxx>
#include <StepBasic_ApprovalDateTime.hxx>
#include <StepBasic_ApprovalPersonOrganization.hxx>
#include <StepBasic_HArray1OfProduct.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductCategoryRelationship.hxx>
#include <StepBasic_ProductContext.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductRelatedProductCategory.hxx>
#include <StepBasic_ProductType.hxx>
#include <STEPConstruct_AP203Context.hxx>
#include <STEPConstruct_Assembly.hxx>
#include <STEPConstruct_ContextTool.hxx>
#include <STEPConstruct_Part.hxx>
#include <StepData_StepModel.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <TCollection_HAsciiString.hxx>
#include "stdio.h"
//#include <StepBasic_ProductDefinitionContext.hxx>
//:i3
//:j4
//=======================================================================
//function : STEPConstruct_ContextTool
//purpose :
//=======================================================================
STEPConstruct_ContextTool::STEPConstruct_ContextTool ()
{
}

View File

@@ -0,0 +1,151 @@
// Created on: 1993-09-14
// Created by: Frederic MAUPAS
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_ContextTool_HeaderFile
#define _STEPConstruct_ContextTool_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <STEPConstruct_AP203Context.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
class StepBasic_ApplicationProtocolDefinition;
class StepGeom_Axis2Placement3d;
class StepData_StepModel;
class TCollection_HAsciiString;
class STEPConstruct_AP203Context;
class STEPConstruct_Part;
class STEPConstruct_Assembly;
//! Maintains global context tool for writing.
//! Gives access to Product Definition Context (one per Model)
//! Maintains ApplicationProtocolDefinition entity (common for all
//! products)
//! Also maintains context specific for AP203 and provides set of
//! methods to work with various STEP constructs as required
//! by Actor
class STEPConstruct_ContextTool
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT STEPConstruct_ContextTool();
Standard_EXPORT STEPConstruct_ContextTool(const Handle(StepData_StepModel)& aStepModel);
//! Initialize ApplicationProtocolDefinition by the first
//! entity of that type found in the model
Standard_EXPORT void SetModel (const Handle(StepData_StepModel)& aStepModel);
Standard_EXPORT Handle(StepBasic_ApplicationProtocolDefinition) GetAPD();
Standard_EXPORT void AddAPD (const Standard_Boolean enforce = Standard_False);
//! Returns True if APD.schema_name is config_control_design
Standard_EXPORT Standard_Boolean IsAP203() const;
//! Returns True if APD.schema_name is automotive_design
Standard_EXPORT Standard_Boolean IsAP214() const;
Standard_EXPORT Handle(TCollection_HAsciiString) GetACstatus();
Standard_EXPORT Handle(TCollection_HAsciiString) GetACschemaName();
Standard_EXPORT Standard_Integer GetACyear();
Standard_EXPORT Handle(TCollection_HAsciiString) GetACname();
Standard_EXPORT void SetACstatus (const Handle(TCollection_HAsciiString)& status);
Standard_EXPORT void SetACschemaName (const Handle(TCollection_HAsciiString)& schemaName);
Standard_EXPORT void SetACyear (const Standard_Integer year);
Standard_EXPORT void SetACname (const Handle(TCollection_HAsciiString)& name);
//! Returns a default axis placement
Standard_EXPORT Handle(StepGeom_Axis2Placement3d) GetDefaultAxis();
//! Returns tool which maintains context specific for AP203
Standard_EXPORT STEPConstruct_AP203Context& AP203Context();
//! Returns current assembly level
Standard_EXPORT Standard_Integer Level() const;
Standard_EXPORT void NextLevel();
Standard_EXPORT void PrevLevel();
//! Changes current assembly level
Standard_EXPORT void SetLevel (const Standard_Integer lev);
//! Returns current index of assembly component on current level
Standard_EXPORT Standard_Integer Index() const;
Standard_EXPORT void NextIndex();
Standard_EXPORT void PrevIndex();
//! Changes current index of assembly component on current level
Standard_EXPORT void SetIndex (const Standard_Integer ind);
//! Generates a product name basing on write.step.product.name
//! parameter and current position in the assembly structure
Standard_EXPORT Handle(TCollection_HAsciiString) GetProductName() const;
//! Produces and returns a full list of root entities required
//! for part identified by SDRTool (including SDR itself)
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetRootsForPart (const STEPConstruct_Part& SDRTool);
//! Produces and returns a full list of root entities required
//! for assembly link identified by assembly (including NAUO and CDSR)
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetRootsForAssemblyLink (const STEPConstruct_Assembly& assembly);
protected:
private:
TColStd_SequenceOfInteger myLevel;
Handle(StepBasic_ApplicationProtocolDefinition) theAPD;
STEPConstruct_AP203Context theAP203;
Handle(StepGeom_Axis2Placement3d) myAxis;
};
#endif // _STEPConstruct_ContextTool_HeaderFile

View File

@@ -1,129 +0,0 @@
-- Created on: 2000-09-29
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-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 ExternRefs from STEPConstruct inherits Tool from STEPConstruct
---Purpose: Provides a tool for analyzing (reading) and creating (writing)
-- references to external files in STEP
--
-- It maintains a data structure in the form of sequences
-- of relevant STEP entities (roots), allowing either to create
-- them by convenient API, or load from existing model and
-- investigate
uses
HAsciiString from TCollection,
SequenceOfTransient from TColStd,
WorkSession from XSControl,
ProductDefinition from StepBasic,
SequenceOfInteger from TColStd,
CString from Standard,
ProductRelatedProductCategory from StepBasic,
DocumentType from StepBasic,
ApplicationProtocolDefinition from StepBasic,
AppliedDocumentReference from StepAP214,
DocumentFile from StepBasic,
ProductContext from StepBasic,
ProductDefinitionContext from StepBasic
is
Create returns ExternRefs;
---Purpose: Creates an empty tool
Create (WS: WorkSession from XSControl) returns ExternRefs;
---Purpose: Creates a tool and initializes it
Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
---Purpose: Initializes tool; returns True if succeeded
Clear (me: in out);
---Purpose: Clears internal fields (list of defined extern refs)
---Scope: Reading
LoadExternRefs (me: in out) returns Boolean;
---Purpose: Searches current STEP model for external references
-- and loads them to the internal data structures
-- NOTE: does not clear data structures before loading
NbExternRefs (me) returns Integer;
---Purpose: Returns number of defined extern references
FileName (me; num: Integer) returns CString;
---Purpose: Returns filename for numth extern reference
-- Returns Null if FileName is not defined or bad
---C++: return const
ProdDef (me; num: Integer) returns ProductDefinition from StepBasic;
---Purpose: Returns ProductDefinition to which numth extern reference
-- is associated.
-- Returns Null if cannot be detected or if extern reference
-- is not associated to SDR in a proper way.
Format (me; num: Integer) returns HAsciiString from TCollection;
---Purpose: Returns format identification string for the extern document
-- Returns Null handle if format is not defined
---Scope: Writing
AddExternRef (me: in out; filename: CString;
PD: ProductDefinition from StepBasic;
format: CString) returns Integer;
---Purpose: Create a new external reference with specified attributes
-- attached to a given SDR
-- <format> can be Null string, in that case this information
-- is not written. Else, it can be "STEP AP214" or "STEP AP203"
-- Returns index of a new extern ref
addAP214ExterRef (me: in out; ADR : AppliedDocumentReference from StepAP214;
PD: ProductDefinition from StepBasic;
DF : DocumentFile from StepBasic;
filename: CString from Standard )
returns Boolean from Standard is protected;
---Purpose: Create a new additional structure entities and add ncessary references
-- Note: do not refer from ADR to DF directly in AP214 (TRJ11).
checkAP214Shared (me: in out);
---Purpose: Check (create if it is null) all shared entities for the model
WriteExternRefs (me; num: Integer) returns Integer;
---Purpose: Adds all the currently defined external refs to the model
-- Returns number of written extern refs
SetAP214APD (me: in out; APD : ApplicationProtocolDefinition from StepBasic);
---Purpose: Set the ApplicationProtocolDefinition of the PDM schema
GetAP214APD (me: in out) returns ApplicationProtocolDefinition from StepBasic;
---Purpose: Returns the ApplicationProtocolDefinition of the PDM schema
-- NOTE: if not defined then create new APD with new Application Context
fields
myAEIAs : SequenceOfTransient from TColStd; -- StepAP214_AppliedExternalIdentificationAssignment
myRoles : SequenceOfTransient from TColStd; -- StepBasic_RoleAssociation
myFormats: SequenceOfTransient from TColStd; -- StepRepr_PropertyDefinitionRepresentation
myShapes : SequenceOfTransient from TColStd; -- StepBasic_ProductDefinition
myTypes : SequenceOfTransient from TColStd; -- StepBasic_DocumentRepresentationType
myIsAP214: SequenceOfInteger from TColStd;
myReplaceNum : SequenceOfInteger from TColStd;
myDocFiles : SequenceOfTransient from TColStd; -- StepBasic_DocumentFile
mySharedPRPC : ProductRelatedProductCategory from StepBasic; -- shared since AP214
mySharedDocType : DocumentType from StepBasic; -- shared since AP214
mySharedPDC : ProductDefinitionContext from StepBasic; -- shared since AP214
mySharedPC : ProductContext from StepBasic; -- shared since AP214
myAPD : ApplicationProtocolDefinition from StepBasic; -- Application Protocol Definition of PDM schema
end ExternRefs;

View File

@@ -13,72 +13,64 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_ExternRefs.ixx>
#include <Interface_EntityIterator.hxx>
#include <StepData_SelectNamed.hxx>
#include <StepBasic_RoleAssociation.hxx>
#include <StepBasic_DocumentRepresentationType.hxx>
#include <StepBasic_DocumentRepresentationType.hxx>
#include <StepBasic_DocumentFile.hxx>
#include <StepBasic_ObjectRole.hxx>
#include <StepBasic_SourceItem.hxx>
#include <StepBasic_DocumentType.hxx>
#include <StepBasic_IdentificationRole.hxx>
#include <StepBasic_ExternalSource.hxx>
#include <StepBasic_ExternalSource.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_PropertyDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepAP203_ApprovedItem.hxx>
#include <StepAP203_CcDesignApproval.hxx>
#include <StepAP203_CcDesignDateAndTimeAssignment.hxx>
#include <StepAP203_CcDesignPersonAndOrganizationAssignment.hxx>
#include <StepAP203_DateTimeItem.hxx>
#include <StepAP203_HArray1OfApprovedItem.hxx>
#include <StepAP203_HArray1OfDateTimeItem.hxx>
#include <StepAP203_HArray1OfPersonOrganizationItem.hxx>
#include <StepAP203_PersonOrganizationItem.hxx>
#include <StepAP214_AppliedDocumentReference.hxx>
#include <StepAP214_AppliedExternalIdentificationAssignment.hxx>
#include <StepAP214_ExternalIdentificationItem.hxx>
#include <StepAP214_HArray1OfExternalIdentificationItem.hxx>
#include <StepAP214_HArray1OfDocumentReferenceItem.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductDefinitionContext.hxx>
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_HArray1OfDocument.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepAP214_HArray1OfExternalIdentificationItem.hxx>
#include <StepBasic_ApplicationContext.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_RepresentedDefinition.hxx>
#include <TCollection_HAsciiString.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepAP203_CcDesignPersonAndOrganizationAssignment.hxx>
#include <StepAP203_HArray1OfPersonOrganizationItem.hxx>
#include <StepAP203_PersonOrganizationItem.hxx>
#include <StepAP203_CcDesignDateAndTimeAssignment.hxx>
#include <StepAP203_HArray1OfDateTimeItem.hxx>
#include <StepAP203_DateTimeItem.hxx>
#include <StepAP203_CcDesignApproval.hxx>
#include <StepAP203_HArray1OfApprovedItem.hxx>
#include <StepAP203_ApprovedItem.hxx>
#include <StepBasic_DocumentProductEquivalence.hxx>
#include <StepBasic_DocumentType.hxx>
#include <StepBasic_HArray1OfProduct.hxx>
#include <StepBasic_ApplicationProtocolDefinition.hxx>
#include <StepBasic_Document.hxx>
#include <StepBasic_DocumentFile.hxx>
#include <StepBasic_DocumentProductEquivalence.hxx>
#include <StepBasic_DocumentRepresentationType.hxx>
#include <StepBasic_DocumentType.hxx>
#include <StepBasic_ExternalSource.hxx>
#include <StepBasic_HArray1OfDocument.hxx>
#include <StepBasic_HArray1OfProduct.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_IdentificationRole.hxx>
#include <StepBasic_ObjectRole.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductContext.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionContext.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
#include <StepBasic_ProductOrFormationOrDefinition.hxx>
#include <StepBasic_ProductRelatedProductCategory.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_RoleAssociation.hxx>
#include <StepBasic_SourceItem.hxx>
#include <STEPConstruct_ExternRefs.hxx>
#include <StepData_SelectNamed.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_PropertyDefinitionRepresentation.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepRepr_RepresentedDefinition.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <TCollection_HAsciiString.hxx>
#include <XSControl_WorkSession.hxx>
//=======================================================================
//function : STEPConstruct_ExternRefs
//purpose :
//=======================================================================
STEPConstruct_ExternRefs::STEPConstruct_ExternRefs ()
{
}

View File

@@ -0,0 +1,150 @@
// Created on: 2000-09-29
// Created by: Andrey BETENEV
// Copyright (c) 2000-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 _STEPConstruct_ExternRefs_HeaderFile
#define _STEPConstruct_ExternRefs_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_SequenceOfTransient.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <STEPConstruct_Tool.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_CString.hxx>
class StepBasic_ProductRelatedProductCategory;
class StepBasic_DocumentType;
class StepBasic_ProductDefinitionContext;
class StepBasic_ProductContext;
class StepBasic_ApplicationProtocolDefinition;
class XSControl_WorkSession;
class StepBasic_ProductDefinition;
class TCollection_HAsciiString;
class StepAP214_AppliedDocumentReference;
class StepBasic_DocumentFile;
//! Provides a tool for analyzing (reading) and creating (writing)
//! references to external files in STEP
//!
//! It maintains a data structure in the form of sequences
//! of relevant STEP entities (roots), allowing either to create
//! them by convenient API, or load from existing model and
//! investigate
class STEPConstruct_ExternRefs : public STEPConstruct_Tool
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an empty tool
Standard_EXPORT STEPConstruct_ExternRefs();
//! Creates a tool and initializes it
Standard_EXPORT STEPConstruct_ExternRefs(const Handle(XSControl_WorkSession)& WS);
//! Initializes tool; returns True if succeeded
Standard_EXPORT Standard_Boolean Init (const Handle(XSControl_WorkSession)& WS);
//! Clears internal fields (list of defined extern refs)
Standard_EXPORT void Clear();
//! Searches current STEP model for external references
//! and loads them to the internal data structures
//! NOTE: does not clear data structures before loading
Standard_EXPORT Standard_Boolean LoadExternRefs();
//! Returns number of defined extern references
Standard_EXPORT Standard_Integer NbExternRefs() const;
//! Returns filename for numth extern reference
//! Returns Null if FileName is not defined or bad
Standard_EXPORT const Standard_CString FileName (const Standard_Integer num) const;
//! Returns ProductDefinition to which numth extern reference
//! is associated.
//! Returns Null if cannot be detected or if extern reference
//! is not associated to SDR in a proper way.
Standard_EXPORT Handle(StepBasic_ProductDefinition) ProdDef (const Standard_Integer num) const;
//! Returns format identification string for the extern document
//! Returns Null handle if format is not defined
Standard_EXPORT Handle(TCollection_HAsciiString) Format (const Standard_Integer num) const;
//! Create a new external reference with specified attributes
//! attached to a given SDR
//! <format> can be Null string, in that case this information
//! is not written. Else, it can be "STEP AP214" or "STEP AP203"
//! Returns index of a new extern ref
Standard_EXPORT Standard_Integer AddExternRef (const Standard_CString filename, const Handle(StepBasic_ProductDefinition)& PD, const Standard_CString format);
//! Check (create if it is null) all shared entities for the model
Standard_EXPORT void checkAP214Shared();
//! Adds all the currently defined external refs to the model
//! Returns number of written extern refs
Standard_EXPORT Standard_Integer WriteExternRefs (const Standard_Integer num) const;
//! Set the ApplicationProtocolDefinition of the PDM schema
Standard_EXPORT void SetAP214APD (const Handle(StepBasic_ApplicationProtocolDefinition)& APD);
//! Returns the ApplicationProtocolDefinition of the PDM schema
//! NOTE: if not defined then create new APD with new Application Context
Standard_EXPORT Handle(StepBasic_ApplicationProtocolDefinition) GetAP214APD();
protected:
//! Create a new additional structure entities and add ncessary references
//! Note: do not refer from ADR to DF directly in AP214 (TRJ11).
Standard_EXPORT Standard_Boolean addAP214ExterRef (const Handle(StepAP214_AppliedDocumentReference)& ADR, const Handle(StepBasic_ProductDefinition)& PD, const Handle(StepBasic_DocumentFile)& DF, const Standard_CString filename);
private:
TColStd_SequenceOfTransient myAEIAs;
TColStd_SequenceOfTransient myRoles;
TColStd_SequenceOfTransient myFormats;
TColStd_SequenceOfTransient myShapes;
TColStd_SequenceOfTransient myTypes;
TColStd_SequenceOfInteger myIsAP214;
TColStd_SequenceOfInteger myReplaceNum;
TColStd_SequenceOfTransient myDocFiles;
Handle(StepBasic_ProductRelatedProductCategory) mySharedPRPC;
Handle(StepBasic_DocumentType) mySharedDocType;
Handle(StepBasic_ProductDefinitionContext) mySharedPDC;
Handle(StepBasic_ProductContext) mySharedPC;
Handle(StepBasic_ApplicationProtocolDefinition) myAPD;
};
#endif // _STEPConstruct_ExternRefs_HeaderFile

View File

@@ -1,108 +0,0 @@
-- Created on: 1993-08-04
-- Created by: Herve LEGRAND
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Part from STEPConstruct
---Purpose: Provides tools for creating STEP structures associated
-- with part (SDR), such as PRODUCT, PDF etc., as requied
-- by current schema
-- Also allows to investigate and modify this data
uses
HAsciiString from TCollection,
ShapeRepresentation from StepShape,
ShapeDefinitionRepresentation from StepShape,
ApplicationContext from StepBasic,
ProductContext from StepBasic,
ApplicationContext from StepBasic,
ProductDefinitionContext from StepBasic,
Product from StepBasic,
ProductDefinitionFormation from StepBasic,
ProductDefinition from StepBasic,
ProductDefinitionShape from StepRepr,
ProductRelatedProductCategory from StepBasic
is
Create returns Part;
MakeSDR (me : in out; aShape: ShapeRepresentation from StepShape;
aName : HAsciiString from TCollection;
AC : ApplicationContext from StepBasic);
ReadSDR (me : in out; aShape: ShapeDefinitionRepresentation from StepShape);
IsDone (me) returns Boolean;
SDRValue (me) returns ShapeDefinitionRepresentation from StepShape;
---Purpose: Returns SDR or Null if not done
SRValue (me) returns ShapeRepresentation from StepShape;
---Purpose: Returns SDR->UsedRepresentation() or Null if not done
PC (me) returns ProductContext from StepBasic;
PCname (me) returns HAsciiString from TCollection;
PCdisciplineType (me) returns HAsciiString from TCollection;
SetPCname (me: in out; name : HAsciiString from TCollection);
SetPCdisciplineType(me: in out; label : HAsciiString from TCollection);
AC (me) returns ApplicationContext from StepBasic;
ACapplication (me) returns HAsciiString from TCollection;
SetACapplication (me: in out; text : HAsciiString from TCollection);
PDC (me) returns ProductDefinitionContext from StepBasic;
PDCname (me) returns HAsciiString from TCollection;
PDCstage (me) returns HAsciiString from TCollection;
SetPDCname (me: in out; label : HAsciiString from TCollection);
SetPDCstage (me: in out; label : HAsciiString from TCollection);
Product (me) returns Product from StepBasic;
Pid (me) returns HAsciiString from TCollection;
Pname (me) returns HAsciiString from TCollection;
Pdescription (me) returns HAsciiString from TCollection;
SetPid (me: in out; id : HAsciiString from TCollection);
SetPname (me: in out; label : HAsciiString from TCollection);
SetPdescription (me: in out; text : HAsciiString from TCollection);
PDF (me) returns ProductDefinitionFormation from StepBasic;
PDFid (me) returns HAsciiString from TCollection;
PDFdescription (me) returns HAsciiString from TCollection;
SetPDFid (me: in out; id : HAsciiString from TCollection);
SetPDFdescription (me: in out; text : HAsciiString from TCollection);
PD (me) returns ProductDefinition from StepBasic;
PDdescription (me) returns HAsciiString from TCollection;
SetPDdescription (me: in out; text : HAsciiString from TCollection);
PDS (me) returns ProductDefinitionShape from StepRepr;
PDSname (me) returns HAsciiString from TCollection;
PDSdescription (me) returns HAsciiString from TCollection;
SetPDSname (me: in out; label : HAsciiString from TCollection);
SetPDSdescription (me: in out; text : HAsciiString from TCollection);
PRPC (me) returns ProductRelatedProductCategory from StepBasic;
PRPCname (me) returns HAsciiString from TCollection;
PRPCdescription (me) returns HAsciiString from TCollection;
SetPRPCname (me: in out; label : HAsciiString from TCollection);
SetPRPCdescription (me: in out; text : HAsciiString from TCollection);
fields
myDone: Boolean;
mySDR : ShapeDefinitionRepresentation from StepShape;
myPRPC: ProductRelatedProductCategory from StepBasic;
end Part;

View File

@@ -15,25 +15,26 @@
//:k9 abv 6 Jan 99: TR10: eliminating duplicated APPLICATION_CONTEXT entities
//:j4 gka 16.03.99 S4134
// abv 20.11.99 renamed from StepPDR_SDRtool
#include <STEPConstruct_Part.ixx>
#include <TCollection_HAsciiString.hxx>
#include <Interface_Static.hxx>
#include <Interface_Static.hxx>
#include <StepBasic_ApplicationContext.hxx>
#include <StepBasic_DesignContext.hxx>
#include <StepBasic_HArray1OfProduct.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_MechanicalContext.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductContext.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionContext.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <StepBasic_ProductDefinitionFormationWithSpecifiedSource.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_DesignContext.hxx>
#include <StepBasic_ProductContext.hxx>
#include <StepBasic_MechanicalContext.hxx>
#include <StepBasic_HArray1OfProductContext.hxx>
#include <StepBasic_ApplicationContext.hxx>
#include <StepBasic_ProductRelatedProductCategory.hxx>
#include <StepBasic_ProductType.hxx>
#include <StepBasic_HArray1OfProduct.hxx>
#include <STEPConstruct_Part.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <TCollection_HAsciiString.hxx>
// ------------------------------
// Modification a faire :
@@ -44,12 +45,10 @@
// du ShapeDefinitionRepresentation.
// Elles se trouvent dans Cc1 au niveau d`une entite racine !
// ------------------------------
//=======================================================================
//function : STEPConstruct_Part
//purpose :
//=======================================================================
STEPConstruct_Part::STEPConstruct_Part()
{
myDone = Standard_False;

View File

@@ -0,0 +1,165 @@
// Created on: 1993-08-04
// Created by: Herve LEGRAND
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_Part_HeaderFile
#define _STEPConstruct_Part_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
class StepShape_ShapeDefinitionRepresentation;
class StepBasic_ProductRelatedProductCategory;
class StepShape_ShapeRepresentation;
class TCollection_HAsciiString;
class StepBasic_ApplicationContext;
class StepBasic_ProductContext;
class StepBasic_ProductDefinitionContext;
class StepBasic_Product;
class StepBasic_ProductDefinitionFormation;
class StepBasic_ProductDefinition;
class StepRepr_ProductDefinitionShape;
//! Provides tools for creating STEP structures associated
//! with part (SDR), such as PRODUCT, PDF etc., as requied
//! by current schema
//! Also allows to investigate and modify this data
class STEPConstruct_Part
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT STEPConstruct_Part();
Standard_EXPORT void MakeSDR (const Handle(StepShape_ShapeRepresentation)& aShape, const Handle(TCollection_HAsciiString)& aName, const Handle(StepBasic_ApplicationContext)& AC);
Standard_EXPORT void ReadSDR (const Handle(StepShape_ShapeDefinitionRepresentation)& aShape);
Standard_EXPORT Standard_Boolean IsDone() const;
//! Returns SDR or Null if not done
Standard_EXPORT Handle(StepShape_ShapeDefinitionRepresentation) SDRValue() const;
//! Returns SDR->UsedRepresentation() or Null if not done
Standard_EXPORT Handle(StepShape_ShapeRepresentation) SRValue() const;
Standard_EXPORT Handle(StepBasic_ProductContext) PC() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PCname() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PCdisciplineType() const;
Standard_EXPORT void SetPCname (const Handle(TCollection_HAsciiString)& name);
Standard_EXPORT void SetPCdisciplineType (const Handle(TCollection_HAsciiString)& label);
Standard_EXPORT Handle(StepBasic_ApplicationContext) AC() const;
Standard_EXPORT Handle(TCollection_HAsciiString) ACapplication() const;
Standard_EXPORT void SetACapplication (const Handle(TCollection_HAsciiString)& text);
Standard_EXPORT Handle(StepBasic_ProductDefinitionContext) PDC() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDCname() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDCstage() const;
Standard_EXPORT void SetPDCname (const Handle(TCollection_HAsciiString)& label);
Standard_EXPORT void SetPDCstage (const Handle(TCollection_HAsciiString)& label);
Standard_EXPORT Handle(StepBasic_Product) Product() const;
Standard_EXPORT Handle(TCollection_HAsciiString) Pid() const;
Standard_EXPORT Handle(TCollection_HAsciiString) Pname() const;
Standard_EXPORT Handle(TCollection_HAsciiString) Pdescription() const;
Standard_EXPORT void SetPid (const Handle(TCollection_HAsciiString)& id);
Standard_EXPORT void SetPname (const Handle(TCollection_HAsciiString)& label);
Standard_EXPORT void SetPdescription (const Handle(TCollection_HAsciiString)& text);
Standard_EXPORT Handle(StepBasic_ProductDefinitionFormation) PDF() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDFid() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDFdescription() const;
Standard_EXPORT void SetPDFid (const Handle(TCollection_HAsciiString)& id);
Standard_EXPORT void SetPDFdescription (const Handle(TCollection_HAsciiString)& text);
Standard_EXPORT Handle(StepBasic_ProductDefinition) PD() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDdescription() const;
Standard_EXPORT void SetPDdescription (const Handle(TCollection_HAsciiString)& text);
Standard_EXPORT Handle(StepRepr_ProductDefinitionShape) PDS() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDSname() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PDSdescription() const;
Standard_EXPORT void SetPDSname (const Handle(TCollection_HAsciiString)& label);
Standard_EXPORT void SetPDSdescription (const Handle(TCollection_HAsciiString)& text);
Standard_EXPORT Handle(StepBasic_ProductRelatedProductCategory) PRPC() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PRPCname() const;
Standard_EXPORT Handle(TCollection_HAsciiString) PRPCdescription() const;
Standard_EXPORT void SetPRPCname (const Handle(TCollection_HAsciiString)& label);
Standard_EXPORT void SetPRPCdescription (const Handle(TCollection_HAsciiString)& text);
protected:
private:
Standard_Boolean myDone;
Handle(StepShape_ShapeDefinitionRepresentation) mySDR;
Handle(StepBasic_ProductRelatedProductCategory) myPRPC;
};
#endif // _STEPConstruct_Part_HeaderFile

View File

@@ -1,39 +0,0 @@
-- Created on: 2003-01-15
-- Created by: data exchange team
-- Copyright (c) 2003-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 PointHasher from STEPConstruct
---Purpose:
uses
Pnt from gp
is
HashCode(myclass; Point : Pnt from gp;
Upper : Integer)
returns Integer;
---Purpose: Returns a HasCode value for the Key <K> in the
-- range 0..Upper.
---C++: inline
IsEqual(myclass; Point1,Point2 : Pnt from gp)
returns Boolean;
---Purpose: Returns True when the two keys are the same. Two
-- same keys must have the same hashcode, the
-- contrary is not necessary.
end PointHasher;

View File

@@ -11,7 +11,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_PointHasher.ixx>
#include <gp_Pnt.hxx>
#include <STEPConstruct_PointHasher.hxx>
//=======================================================================
//function : IsEqual

View File

@@ -0,0 +1,69 @@
// Created on: 2003-01-15
// Created by: data exchange team
// Copyright (c) 2003-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 _STEPConstruct_PointHasher_HeaderFile
#define _STEPConstruct_PointHasher_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class gp_Pnt;
class STEPConstruct_PointHasher
{
public:
DEFINE_STANDARD_ALLOC
//! Returns a HasCode value for the Key <K> in the
//! range 0..Upper.
static Standard_Integer HashCode (const gp_Pnt& Point, const Standard_Integer Upper);
//! Returns True when the two keys are the same. Two
//! same keys must have the same hashcode, the
//! contrary is not necessary.
Standard_EXPORT static Standard_Boolean IsEqual (const gp_Pnt& Point1, const gp_Pnt& Point2);
protected:
private:
};
#include <STEPConstruct_PointHasher.lxx>
#endif // _STEPConstruct_PointHasher_HeaderFile

View File

@@ -1,183 +0,0 @@
-- Created on: 1999-09-10
-- Created by: Andrey BETENEV
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Styles from STEPConstruct inherits Tool from STEPConstruct
---Purpose: Provides a mechanism for reading and writing shape styles
-- (such as color) to and from the STEP file
-- This tool maintains a list of styles, either taking them
-- from STEP model (reading), or filling it by calls to
-- AddStyle or directly (writing).
-- Some methods deal with general structures of styles and
-- presentations in STEP, but there are methods which deal
-- with particular implementation of colors (as described in RP)
uses
WorkSession from XSControl,
InterfaceModel from Interface,
HGraph from Interface,
FinderProcess from Transfer,
TransientProcess from Transfer,
Shape from TopoDS,
SequenceOfTransient from TColStd,
HSequenceOfTransient from TColStd,
MapOfShape from TopTools,
RepresentationItem from StepRepr,
RepresentationContext from StepRepr,
PresentationStyleAssignment from StepVisual,
StyledItem from StepVisual,
Colour from StepVisual,
Color from Quantity,
IndexedMapOfTransient from TColStd,
IndexedDataMapOfTransientTransient from TColStd,
MechanicalDesignGeometricPresentationRepresentation from StepVisual,
ContextDependentShapeRepresentation from StepShape,
ProductDefinitionShape from StepRepr,
DataMapOfAsciiStringTransient from STEPConstruct,
DataMapOfPointTransient from STEPConstruct
is
Create returns Styles;
---Purpose: Creates an empty tool
Create (WS: WorkSession from XSControl) returns Styles;
---Purpose: Creates a tool and initializes it
Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
---Purpose: Initializes tool; returns True if succeeded
--Basic methods: general work with styles
NbStyles (me) returns Integer;
---Purpose: Returns number of defined styles
Style (me; i: Integer) returns StyledItem from StepVisual;
---Purpose: Returns style with given index
ClearStyles (me: in out);
---Purpose: Clears all defined styles and PSA sequence
AddStyle (me: in out; style: StyledItem from StepVisual);
---Purpose: Adds a style to a sequence
AddStyle (me: in out; item: RepresentationItem from StepRepr;
PSA: PresentationStyleAssignment from StepVisual;
Override: StyledItem from StepVisual)
returns StyledItem from StepVisual;
---Purpose: Create a style linking giving PSA to the item, and add it to the
-- sequence of stored styles. If Override is not Null, then
-- the resulting style will be of the subtype OverridingStyledItem.
AddStyle (me: in out; Shape: Shape from TopoDS;
PSA: PresentationStyleAssignment from StepVisual;
Override: StyledItem from StepVisual)
returns StyledItem from StepVisual;
---Purpose: Create a style linking giving PSA to the Shape, and add it to the
-- sequence of stored styles. If Override is not Null, then
-- the resulting style will be of the subtype OverridingStyledItem.
-- The Sape is used to find corresponding STEP entity by call to
-- STEPConstruct::FindEntity(), then previous method is called.
CreateMDGPR (me: in out; Context: RepresentationContext from StepRepr;
MDGPR :in out MechanicalDesignGeometricPresentationRepresentation from StepVisual)
returns Boolean;
---Purpose: Create MDGPR, fill it with all the styles previously defined,
-- and add it to the model
CreateNAUOSRD (me: in out; Context: RepresentationContext from StepRepr;
CDSR : ContextDependentShapeRepresentation from StepShape;
initPDS : ProductDefinitionShape from StepRepr)
returns Boolean;
---Purpose: Create MDGPR, fill it with all the styles previously defined,
-- and add it to the model
-- IMPORTANT: <initPDS> must be null when use for NAUO colors
-- <initPDS> initialised only for SHUO case.
FindContext (me; Shape: Shape from TopoDS)
returns RepresentationContext from StepRepr;
---Purpose: Searches the STEP model for the RepresentationContext in which
-- given shape is defined. This context (if found) can be used
-- then in call to CreateMDGPR()
LoadStyles (me: in out) returns Boolean;
---Purpose: Searches the STEP model for the MDGPR or DM entities
-- (which bring styles) and fills sequence of styles
LoadInvisStyles (me; InvSyles : in out HSequenceOfTransient from TColStd)
returns Boolean;
---Purpose: Searches the STEP model for the INISIBILITY enteties
-- (which bring styles) and fills out sequence of styles
--Specialized methods: work with colors
MakeColorPSA (me; item: RepresentationItem from StepRepr;
SurfCol: Colour from StepVisual;
CurveCol: Colour from StepVisual;
isForNAUO : Boolean from Standard = Standard_False)
returns PresentationStyleAssignment from StepVisual;
---Purpose: Create a PresentationStyleAssignment entity which defines
-- two colors (for filling surfaces and curves)
-- if isForNAUO true then returns PresentationStyleByContext
GetColorPSA (me: in out; item: RepresentationItem from StepRepr;
Col: Colour from StepVisual)
returns PresentationStyleAssignment from StepVisual;
---Purpose: Returns a PresentationStyleAssignment entity which defines
-- surface and curve colors as Col. This PSA is either created
-- or taken from internal map where all PSAs created by this
-- method are remembered.
GetColors (me; style: StyledItem from StepVisual;
SurfCol : out Colour from StepVisual;
BoundCol: out Colour from StepVisual;
CurveCol: out Colour from StepVisual;
IsComponent: in out Boolean from Standard)
returns Boolean;
---Purpose: Extract color definitions from the style entity
-- For each type of color supported, result can be either
-- NULL if it is not defined by that style, or last
-- definition (if they are 1 or more)
--Auxiliary methods: conversions between STEP and CASCADE color definitions
EncodeColor (myclass; Col: Color from Quantity) returns Colour from StepVisual;
---Purpose: Create STEP color entity by given Quantity_Color
-- The analysis is performed for whether the color corresponds to
-- one of standard colors predefined in STEP. In that case,
-- PredefinedColour entity is created instead of RGBColour
EncodeColor (myclass; Col: Color from Quantity;
DPDCs : in out DataMapOfAsciiStringTransient from STEPConstruct;
ColRGBs : in out DataMapOfPointTransient from STEPConstruct)
returns Colour from StepVisual;
---Purpose: Create STEP color entity by given Quantity_Color
-- The analysis is performed for whether the color corresponds to
-- one of standard colors predefined in STEP. In that case,
-- PredefinedColour entity is created instead of RGBColour
DecodeColor (myclass; Colour: Colour from StepVisual;
Col : out Color from Quantity)
returns Boolean;
---Purpose: Decodes STEP color and fills the Quantity_Color.
-- Returns True if OK or False if color is not recognized
fields
myMapOfStyles : IndexedDataMapOfTransientTransient from TColStd;
myStyles : IndexedMapOfTransient from TColStd;
myPSA : SequenceOfTransient from TColStd;
end Styles;

View File

@@ -14,73 +14,74 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_Styles.ixx>
#include <STEPConstruct.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TopoDS_Iterator.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <Interface_Graph.hxx>
#include <Interface_Static.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_EntityIterator.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <TransferBRep.hxx>
#include <Transfer_Binder.hxx>
#include <APIHeaderSection_MakeHeader.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <gp_Pnt.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Graph.hxx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_Static.hxx>
#include <Quantity_Color.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <STEPConstruct.hxx>
#include <STEPConstruct_Styles.hxx>
#include <StepData_StepModel.hxx>
#include <StepGeom_GeometricRepresentationItem.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_ItemDefinedTransformation.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_Representation.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepRepr_RepresentationRelationshipWithTransformation.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <StepRepr_Transformation.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepVisual_Colour.hxx>
#include <StepVisual_ColourRgb.hxx>
#include <StepVisual_CurveStyle.hxx>
#include <StepVisual_DraughtingModel.hxx>
#include <StepVisual_DraughtingPreDefinedColour.hxx>
#include <StepVisual_DraughtingPreDefinedCurveFont.hxx>
#include <StepVisual_FillAreaStyle.hxx>
#include <StepVisual_FillAreaStyleColour.hxx>
#include <StepVisual_FillStyleSelect.hxx>
#include <StepVisual_HArray1OfFillStyleSelect.hxx>
#include <StepVisual_FillAreaStyle.hxx>
#include <StepVisual_SurfaceStyleFillArea.hxx>
#include <StepVisual_SurfaceStyleElementSelect.hxx>
#include <StepVisual_HArray1OfSurfaceStyleElementSelect.hxx>
#include <StepVisual_SurfaceSideStyle.hxx>
#include <StepVisual_SurfaceStyleUsage.hxx>
#include <StepVisual_PresentationStyleSelect.hxx>
#include <StepVisual_HArray1OfPresentationStyleSelect.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_OverRidingStyledItem.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleSelect.hxx>
#include <StepVisual_HArray1OfSurfaceStyleElementSelect.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_InvisibleItem.hxx>
#include <StepVisual_MechanicalDesignGeometricPresentationRepresentation.hxx>
#include <StepVisual_OverRidingStyledItem.hxx>
#include <StepVisual_PreDefinedColour.hxx>
#include <StepVisual_PreDefinedItem.hxx>
#include <StepVisual_CurveStyle.hxx>
#include <StepVisual_DraughtingPreDefinedCurveFont.hxx>
#include <StepVisual_SurfaceStyleBoundary.hxx>
#include <StepVisual_DraughtingPreDefinedColour.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepVisual_DraughtingModel.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <StepRepr_RepresentationRelationshipWithTransformation.hxx>
#include <StepRepr_Transformation.hxx>
#include <StepRepr_ItemDefinedTransformation.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_PresentationStyleSelect.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_SurfaceSideStyle.hxx>
#include <StepVisual_SurfaceStyleBoundary.hxx>
#include <StepVisual_SurfaceStyleElementSelect.hxx>
#include <StepVisual_SurfaceStyleFillArea.hxx>
#include <StepVisual_SurfaceStyleUsage.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <StepVisual_InvisibleItem.hxx>
#include <gp_Pnt.hxx>
#include <StepData_StepModel.hxx>
#include <StepRepr_Representation.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_Binder.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_WorkSession.hxx>
//=======================================================================
//function : STEPConstruct_Styles
//purpose :
//=======================================================================
STEPConstruct_Styles::STEPConstruct_Styles ()
{
}

View File

@@ -0,0 +1,176 @@
// Created on: 1999-09-10
// Created by: Andrey BETENEV
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_Styles_HeaderFile
#define _STEPConstruct_Styles_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
#include <TColStd_IndexedMapOfTransient.hxx>
#include <TColStd_SequenceOfTransient.hxx>
#include <STEPConstruct_Tool.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <STEPConstruct_DataMapOfAsciiStringTransient.hxx>
#include <STEPConstruct_DataMapOfPointTransient.hxx>
class XSControl_WorkSession;
class StepVisual_StyledItem;
class StepRepr_RepresentationItem;
class StepVisual_PresentationStyleAssignment;
class TopoDS_Shape;
class StepRepr_RepresentationContext;
class StepVisual_MechanicalDesignGeometricPresentationRepresentation;
class StepShape_ContextDependentShapeRepresentation;
class StepRepr_ProductDefinitionShape;
class StepVisual_Colour;
class Quantity_Color;
//! Provides a mechanism for reading and writing shape styles
//! (such as color) to and from the STEP file
//! This tool maintains a list of styles, either taking them
//! from STEP model (reading), or filling it by calls to
//! AddStyle or directly (writing).
//! Some methods deal with general structures of styles and
//! presentations in STEP, but there are methods which deal
//! with particular implementation of colors (as described in RP)
class STEPConstruct_Styles : public STEPConstruct_Tool
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an empty tool
Standard_EXPORT STEPConstruct_Styles();
//! Creates a tool and initializes it
Standard_EXPORT STEPConstruct_Styles(const Handle(XSControl_WorkSession)& WS);
//! Initializes tool; returns True if succeeded
Standard_EXPORT Standard_Boolean Init (const Handle(XSControl_WorkSession)& WS);
//! Returns number of defined styles
Standard_EXPORT Standard_Integer NbStyles() const;
//! Returns style with given index
Standard_EXPORT Handle(StepVisual_StyledItem) Style (const Standard_Integer i) const;
//! Clears all defined styles and PSA sequence
Standard_EXPORT void ClearStyles();
//! Adds a style to a sequence
Standard_EXPORT void AddStyle (const Handle(StepVisual_StyledItem)& style);
//! Create a style linking giving PSA to the item, and add it to the
//! sequence of stored styles. If Override is not Null, then
//! the resulting style will be of the subtype OverridingStyledItem.
Standard_EXPORT Handle(StepVisual_StyledItem) AddStyle (const Handle(StepRepr_RepresentationItem)& item, const Handle(StepVisual_PresentationStyleAssignment)& PSA, const Handle(StepVisual_StyledItem)& Override);
//! Create a style linking giving PSA to the Shape, and add it to the
//! sequence of stored styles. If Override is not Null, then
//! the resulting style will be of the subtype OverridingStyledItem.
//! The Sape is used to find corresponding STEP entity by call to
//! STEPConstruct::FindEntity(), then previous method is called.
Standard_EXPORT Handle(StepVisual_StyledItem) AddStyle (const TopoDS_Shape& Shape, const Handle(StepVisual_PresentationStyleAssignment)& PSA, const Handle(StepVisual_StyledItem)& Override);
//! Create MDGPR, fill it with all the styles previously defined,
//! and add it to the model
Standard_EXPORT Standard_Boolean CreateMDGPR (const Handle(StepRepr_RepresentationContext)& Context, Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation)& MDGPR);
//! Create MDGPR, fill it with all the styles previously defined,
//! and add it to the model
//! IMPORTANT: <initPDS> must be null when use for NAUO colors
//! <initPDS> initialised only for SHUO case.
Standard_EXPORT Standard_Boolean CreateNAUOSRD (const Handle(StepRepr_RepresentationContext)& Context, const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR, const Handle(StepRepr_ProductDefinitionShape)& initPDS);
//! Searches the STEP model for the RepresentationContext in which
//! given shape is defined. This context (if found) can be used
//! then in call to CreateMDGPR()
Standard_EXPORT Handle(StepRepr_RepresentationContext) FindContext (const TopoDS_Shape& Shape) const;
//! Searches the STEP model for the MDGPR or DM entities
//! (which bring styles) and fills sequence of styles
Standard_EXPORT Standard_Boolean LoadStyles();
//! Searches the STEP model for the INISIBILITY enteties
//! (which bring styles) and fills out sequence of styles
Standard_EXPORT Standard_Boolean LoadInvisStyles (Handle(TColStd_HSequenceOfTransient)& InvSyles) const;
//! Create a PresentationStyleAssignment entity which defines
//! two colors (for filling surfaces and curves)
//! if isForNAUO true then returns PresentationStyleByContext
Standard_EXPORT Handle(StepVisual_PresentationStyleAssignment) MakeColorPSA (const Handle(StepRepr_RepresentationItem)& item, const Handle(StepVisual_Colour)& SurfCol, const Handle(StepVisual_Colour)& CurveCol, const Standard_Boolean isForNAUO = Standard_False) const;
//! Returns a PresentationStyleAssignment entity which defines
//! surface and curve colors as Col. This PSA is either created
//! or taken from internal map where all PSAs created by this
//! method are remembered.
Standard_EXPORT Handle(StepVisual_PresentationStyleAssignment) GetColorPSA (const Handle(StepRepr_RepresentationItem)& item, const Handle(StepVisual_Colour)& Col);
//! Extract color definitions from the style entity
//! For each type of color supported, result can be either
//! NULL if it is not defined by that style, or last
//! definition (if they are 1 or more)
Standard_EXPORT Standard_Boolean GetColors (const Handle(StepVisual_StyledItem)& style, Handle(StepVisual_Colour)& SurfCol, Handle(StepVisual_Colour)& BoundCol, Handle(StepVisual_Colour)& CurveCol, Standard_Boolean& IsComponent) const;
//! Create STEP color entity by given Quantity_Color
//! The analysis is performed for whether the color corresponds to
//! one of standard colors predefined in STEP. In that case,
//! PredefinedColour entity is created instead of RGBColour
Standard_EXPORT static Handle(StepVisual_Colour) EncodeColor (const Quantity_Color& Col);
//! Create STEP color entity by given Quantity_Color
//! The analysis is performed for whether the color corresponds to
//! one of standard colors predefined in STEP. In that case,
//! PredefinedColour entity is created instead of RGBColour
Standard_EXPORT static Handle(StepVisual_Colour) EncodeColor (const Quantity_Color& Col, STEPConstruct_DataMapOfAsciiStringTransient& DPDCs, STEPConstruct_DataMapOfPointTransient& ColRGBs);
//! Decodes STEP color and fills the Quantity_Color.
//! Returns True if OK or False if color is not recognized
Standard_EXPORT static Standard_Boolean DecodeColor (const Handle(StepVisual_Colour)& Colour, Quantity_Color& Col);
protected:
private:
TColStd_IndexedDataMapOfTransientTransient myMapOfStyles;
TColStd_IndexedMapOfTransient myStyles;
TColStd_SequenceOfTransient myPSA;
};
#endif // _STEPConstruct_Styles_HeaderFile

View File

@@ -1,82 +0,0 @@
-- Created on: 2000-09-29
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-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 Tool from STEPConstruct
---Purpose: Provides basic functionalities for tools which are intended
-- for encoding/decoding specific STEP constructs
--
-- It is initialized by WorkSession and allows easy access to
-- its fields and internal data such as Model, TP and FP
--
-- NOTE: Call to method Graph() with True (or for a first time,
-- if you have updated the model since last computation of model)
-- can take a time, so it is recommended to avoid creation of
-- this (and derived) tool multiple times
uses
WorkSession from XSControl,
InterfaceModel from Interface,
Graph from Interface,
HGraph from Interface,
FinderProcess from Transfer,
TransientProcess from Transfer
is
Create returns Tool;
---Purpose: Creates an empty tool
Create (WS: WorkSession from XSControl) returns Tool;
---Purpose: Creates a tool and loads it with worksession
SetWS (me: in out; WS: WorkSession from XSControl)
returns Boolean is protected;
---Purpose: Load worksession; returns True if succeeded
-- Returns False if either FinderProcess of TransientProcess
-- cannot be obtained or are Null
WS (me) returns WorkSession from XSControl;
---Purpose: Returns currently loaded WorkSession
---C++: return const &
---C++: inline
Model (me) returns InterfaceModel from Interface;
---Purpose: Returns current model (Null if not loaded)
---C++: inline
Graph (me; recompute: Boolean = Standard_False) returns Graph from Interface;
---Purpose: Returns current graph (recomputing if necessary)
---C++: return const &
---C++: inline
TransientProcess (me) returns TransientProcess from Transfer;
---Purpose: Returns TransientProcess (reading; Null if not loaded)
---C++: return const &
---C++: inline
FinderProcess (me) returns FinderProcess from Transfer;
---Purpose: Returns FinderProcess (writing; Null if not loaded)
---C++: return const &
---C++: inline
fields
myWS : WorkSession from XSControl;
myFinderProcess: FinderProcess from Transfer;
myTransientProcess: TransientProcess from Transfer;
myHGraph : HGraph from Interface; -- for optimization (no recomutings)
end Tool;

View File

@@ -13,15 +13,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_Tool.ixx>
#include <Interface_Graph.hxx>
#include <Interface_HGraph.hxx>
#include <Interface_InterfaceModel.hxx>
#include <STEPConstruct_Tool.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Transfer_TransientProcess.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_WorkSession.hxx>
//=======================================================================
//function : STEPConstruct_Tool
//purpose :
//=======================================================================
STEPConstruct_Tool::STEPConstruct_Tool ()
{
}

View File

@@ -0,0 +1,103 @@
// Created on: 2000-09-29
// Created by: Andrey BETENEV
// Copyright (c) 2000-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 _STEPConstruct_Tool_HeaderFile
#define _STEPConstruct_Tool_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
class XSControl_WorkSession;
class Transfer_FinderProcess;
class Transfer_TransientProcess;
class Interface_HGraph;
class Interface_InterfaceModel;
class Interface_Graph;
//! Provides basic functionalities for tools which are intended
//! for encoding/decoding specific STEP constructs
//!
//! It is initialized by WorkSession and allows easy access to
//! its fields and internal data such as Model, TP and FP
//!
//! NOTE: Call to method Graph() with True (or for a first time,
//! if you have updated the model since last computation of model)
//! can take a time, so it is recommended to avoid creation of
//! this (and derived) tool multiple times
class STEPConstruct_Tool
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an empty tool
Standard_EXPORT STEPConstruct_Tool();
//! Creates a tool and loads it with worksession
Standard_EXPORT STEPConstruct_Tool(const Handle(XSControl_WorkSession)& WS);
//! Returns currently loaded WorkSession
const Handle(XSControl_WorkSession)& WS() const;
//! Returns current model (Null if not loaded)
Handle(Interface_InterfaceModel) Model() const;
//! Returns current graph (recomputing if necessary)
const Interface_Graph& Graph (const Standard_Boolean recompute = Standard_False) const;
//! Returns TransientProcess (reading; Null if not loaded)
const Handle(Transfer_TransientProcess)& TransientProcess() const;
//! Returns FinderProcess (writing; Null if not loaded)
const Handle(Transfer_FinderProcess)& FinderProcess() const;
protected:
//! Load worksession; returns True if succeeded
//! Returns False if either FinderProcess of TransientProcess
//! cannot be obtained or are Null
Standard_EXPORT Standard_Boolean SetWS (const Handle(XSControl_WorkSession)& WS);
private:
Handle(XSControl_WorkSession) myWS;
Handle(Transfer_FinderProcess) myFinderProcess;
Handle(Transfer_TransientProcess) myTransientProcess;
Handle(Interface_HGraph) myHGraph;
};
#include <STEPConstruct_Tool.lxx>
#endif // _STEPConstruct_Tool_HeaderFile

View File

@@ -1,129 +0,0 @@
-- Created on: 1996-01-18
-- Created by: Frederic MAUPAS
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class UnitContext from STEPConstruct
---Purpose: Tool for creation (encoding) and decoding (for writing and reading
-- accordingly) context defining units and tolerances (uncerntanties)
uses
SiUnit from StepBasic,
SiPrefix from StepBasic,
NamedUnit from StepBasic,
GlobalUnitAssignedContext from StepRepr,
GlobalUncertaintyAssignedContext from StepRepr,
GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx from StepGeom
is
Create returns UnitContext;
---Purpose: Creates empty tool
Init (me: in out; Tol3d: Real);
---Purpose: Creates new context (units are MM and radians,
-- uncertainty equal to Tol3d)
IsDone (me) returns Boolean;
---Purpose: Returns True if Init was called successfully
Value (me) returns GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx from StepGeom;
---Purpose: Returns context (or Null if not done)
ComputeFactors(me: in out; aContext: GlobalUnitAssignedContext from StepRepr)
returns Integer;
---Purpose: Computes the length, plane angle and solid angle conversion
-- factor . Returns a status, 0 if OK
ComputeFactors(me: in out; aUnit: NamedUnit from StepBasic)
returns Integer;
ComputeTolerance(me: in out; aContext: GlobalUncertaintyAssignedContext from StepRepr)
returns Integer;
---Purpose : Computes the uncertainty value (for length)
LengthFactor(me) returns Real;
---Purpose: Returns the lengthFactor
PlaneAngleFactor(me) returns Real;
---Purpose: Returns the planeAngleFactor
SolidAngleFactor(me) returns Real;
---Purpose: Returns the solidAngleFactor
Uncertainty(me) returns Real;
---Purpose: Returns the Uncertainty value (for length)
-- It has been converted with LengthFactor
AreaFactor(me) returns Real;
---Purpose: Returns the areaFactor
VolumeFactor(me) returns Real;
---Purpose: Returns the volumeFactor
HasUncertainty(me) returns Boolean;
---Purpose: Tells if a Uncertainty (for length) is recorded
LengthDone(me) returns Boolean;
---Purpose: Returns true if ComputeFactors has calculated
-- a LengthFactor
PlaneAngleDone(me) returns Boolean;
---Purpose: Returns true if ComputeFactors has calculated
-- a PlaneAngleFactor
SolidAngleDone(me) returns Boolean;
---Purpose: Returns true if ComputeFactors has calculated
-- a SolidAngleFactor
AreaDone(me) returns Boolean;
---Purpose: Returns true if areaFactor is computed
VolumeDone(me) returns Boolean;
---Purpose: Returns true if volumeFactor is computed
SiUnitNameFactor(me; aSiUnit : SiUnit from StepBasic; val : out Real)
returns Boolean is private;
---Purpose: Fills numerical equivalent of SiUnitName (in SI value)
-- Returns False if name SiUnit Name not recognized
StatusMessage (me; status :Integer) returns CString;
---Purpose: Returns a message for a given status (0 - empty)
-- This message can then be added as warning for transfer
ConvertSiPrefix (myclass; aPrefix: SiPrefix from StepBasic) returns Real;
---Purpose: Convert SI prefix defined by enumertaion to corresponding
-- real factor (e.g. 1e6 for mega)
fields
-- writing (encoding)
done: Boolean;
GRC : GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx from StepGeom;
-- reading (decoding)
lengthFactor : Real;
planeAngleFactor : Real;
solidAngleFactor : Real;
theUncertainty : Real;
areaFactor : Real;
volumeFactor : Real;
areaDone : Boolean;
volumeDone : Boolean;
lengthDone : Boolean;
planeAngleDone : Boolean;
solidAngleDone : Boolean;
hasUncertainty : Boolean;
end UnitContext;

View File

@@ -17,44 +17,44 @@
//abv 17.11.99: renamed from StepPDR_MakeUnitAndToleranceContext and merged with STEPControl_Unit
//abv 30.02.00: ability to write file in units other than MM
#include <STEPConstruct_UnitContext.ixx>
#include <TCollection_HAsciiString.hxx>
#include <StepBasic_SiUnit.hxx>
#include <StepBasic_SiPrefix.hxx>
#include <StepBasic_NamedUnit.hxx>
#include <StepBasic_LengthUnit.hxx>
#include <StepBasic_PlaneAngleUnit.hxx>
#include <StepBasic_SolidAngleUnit.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
#include <StepBasic_SiUnitAndSolidAngleUnit.hxx>
#include <StepBasic_SiUnitAndAreaUnit.hxx>
#include <StepBasic_SiUnitAndVolumeUnit.hxx>
#include <StepBasic_UncertaintyMeasureWithUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_PlaneAngleMeasureWithUnit.hxx>
#include <StepBasic_SolidAngleMeasureWithUnit.hxx>
#include <Interface_Static.hxx>
#include <StepBasic_ConversionBasedUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndAreaUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndLengthUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndPlaneAngleUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndSolidAngleUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndAreaUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndVolumeUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_HArray1OfNamedUnit.hxx>
#include <StepBasic_HArray1OfUncertaintyMeasureWithUnit.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_LengthUnit.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_NamedUnit.hxx>
#include <StepBasic_PlaneAngleMeasureWithUnit.hxx>
#include <StepBasic_PlaneAngleUnit.hxx>
#include <StepBasic_SiPrefix.hxx>
#include <StepBasic_SiUnit.hxx>
#include <StepBasic_SiUnitAndAreaUnit.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
#include <StepBasic_SiUnitAndSolidAngleUnit.hxx>
#include <StepBasic_SiUnitAndVolumeUnit.hxx>
#include <StepBasic_SolidAngleMeasureWithUnit.hxx>
#include <StepBasic_SolidAngleUnit.hxx>
#include <StepBasic_UncertaintyMeasureWithUnit.hxx>
#include <STEPConstruct_UnitContext.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
#include <StepRepr_GlobalUnitAssignedContext.hxx>
#include <TCollection_HAsciiString.hxx>
#include <UnitsMethods.hxx>
#include <Interface_Static.hxx>
#include <StepBasic_ConversionBasedUnit.hxx>
//=======================================================================
//function : STEPConstruct_UnitContext
//purpose :
//=======================================================================
STEPConstruct_UnitContext::STEPConstruct_UnitContext() : done(Standard_False)
{
lengthDone = planeAngleDone = solidAngleDone = hasUncertainty =

View File

@@ -0,0 +1,156 @@
// Created on: 1996-01-18
// Created by: Frederic MAUPAS
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_UnitContext_HeaderFile
#define _STEPConstruct_UnitContext_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_CString.hxx>
#include <StepBasic_SiPrefix.hxx>
class StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx;
class StepRepr_GlobalUnitAssignedContext;
class StepBasic_NamedUnit;
class StepRepr_GlobalUncertaintyAssignedContext;
class StepBasic_SiUnit;
//! Tool for creation (encoding) and decoding (for writing and reading
//! accordingly) context defining units and tolerances (uncerntanties)
class STEPConstruct_UnitContext
{
public:
DEFINE_STANDARD_ALLOC
//! Creates empty tool
Standard_EXPORT STEPConstruct_UnitContext();
//! Creates new context (units are MM and radians,
//! uncertainty equal to Tol3d)
Standard_EXPORT void Init (const Standard_Real Tol3d);
//! Returns True if Init was called successfully
Standard_EXPORT Standard_Boolean IsDone() const;
//! Returns context (or Null if not done)
Standard_EXPORT Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx) Value() const;
//! Computes the length, plane angle and solid angle conversion
//! factor . Returns a status, 0 if OK
Standard_EXPORT Standard_Integer ComputeFactors (const Handle(StepRepr_GlobalUnitAssignedContext)& aContext);
Standard_EXPORT Standard_Integer ComputeFactors (const Handle(StepBasic_NamedUnit)& aUnit);
//! Computes the uncertainty value (for length)
Standard_EXPORT Standard_Integer ComputeTolerance (const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aContext);
//! Returns the lengthFactor
Standard_EXPORT Standard_Real LengthFactor() const;
//! Returns the planeAngleFactor
Standard_EXPORT Standard_Real PlaneAngleFactor() const;
//! Returns the solidAngleFactor
Standard_EXPORT Standard_Real SolidAngleFactor() const;
//! Returns the Uncertainty value (for length)
//! It has been converted with LengthFactor
Standard_EXPORT Standard_Real Uncertainty() const;
//! Returns the areaFactor
Standard_EXPORT Standard_Real AreaFactor() const;
//! Returns the volumeFactor
Standard_EXPORT Standard_Real VolumeFactor() const;
//! Tells if a Uncertainty (for length) is recorded
Standard_EXPORT Standard_Boolean HasUncertainty() const;
//! Returns true if ComputeFactors has calculated
//! a LengthFactor
Standard_EXPORT Standard_Boolean LengthDone() const;
//! Returns true if ComputeFactors has calculated
//! a PlaneAngleFactor
Standard_EXPORT Standard_Boolean PlaneAngleDone() const;
//! Returns true if ComputeFactors has calculated
//! a SolidAngleFactor
Standard_EXPORT Standard_Boolean SolidAngleDone() const;
//! Returns true if areaFactor is computed
Standard_EXPORT Standard_Boolean AreaDone() const;
//! Returns true if volumeFactor is computed
Standard_EXPORT Standard_Boolean VolumeDone() const;
//! Returns a message for a given status (0 - empty)
//! This message can then be added as warning for transfer
Standard_EXPORT Standard_CString StatusMessage (const Standard_Integer status) const;
//! Convert SI prefix defined by enumertaion to corresponding
//! real factor (e.g. 1e6 for mega)
Standard_EXPORT static Standard_Real ConvertSiPrefix (const StepBasic_SiPrefix aPrefix);
protected:
private:
//! Fills numerical equivalent of SiUnitName (in SI value)
//! Returns False if name SiUnit Name not recognized
Standard_EXPORT Standard_Boolean SiUnitNameFactor (const Handle(StepBasic_SiUnit)& aSiUnit, Standard_Real& val) const;
Standard_Boolean done;
Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx) GRC;
Standard_Real lengthFactor;
Standard_Real planeAngleFactor;
Standard_Real solidAngleFactor;
Standard_Real theUncertainty;
Standard_Real areaFactor;
Standard_Real volumeFactor;
Standard_Boolean areaDone;
Standard_Boolean volumeDone;
Standard_Boolean lengthDone;
Standard_Boolean planeAngleDone;
Standard_Boolean solidAngleDone;
Standard_Boolean hasUncertainty;
};
#endif // _STEPConstruct_UnitContext_HeaderFile

View File

@@ -1,150 +0,0 @@
-- Created on: 1999-09-08
-- Created by: Andrey BETENEV
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ValidationProps from STEPConstruct inherits Tool from STEPConstruct
---Purpose: This class provides tools for access (write and read)
-- the validation properties on shapes in the STEP file.
-- These are surface area, solid volume and centroid.
uses
WorkSession from XSControl,
InterfaceModel from Interface,
HGraph from Interface,
FinderProcess from Transfer,
TransientProcess from Transfer,
RepresentationItem from StepRepr,
Pnt from gp,
Shape from TopoDS,
MapOfShape from TopTools,
SequenceOfTransient from TColStd,
Unit from StepBasic,
CharacterizedDefinition from StepRepr,
RepresentationContext from StepRepr,
--ShapeDefinitionRepresentation from StepShape,
--ContextDependentShapeRepresentation from StepShape,
ProductDefinition from StepBasic,
NextAssemblyUsageOccurrence from StepRepr,
PropertyDefinition from StepRepr,
RepresentationContext from StepRepr
is
Create returns ValidationProps;
---Purpose: Creates an empty tool
Create (WS: WorkSession from XSControl) returns ValidationProps;
---Purpose: Creates a tool and loads it with worksession
Init (me: in out; WS: WorkSession from XSControl) returns Boolean;
---Purpose: Load worksession; returns True if succeeded
AddProp (me: in out; Shape: Shape from TopoDS;
Prop: RepresentationItem from StepRepr;
Descr: CString;
instance: Boolean = Standard_False)
returns Boolean;
---Purpose: General method for adding (writing) a validation property
-- for shape which should be already mapped on writing itself.
-- It uses FindTarget() to find target STEP entity
-- resulting from given shape, and associated context
-- Returns True if success, False in case of fail
AddProp (me: in out; target: CharacterizedDefinition from StepRepr;
Context: RepresentationContext from StepRepr;
Prop: RepresentationItem from StepRepr;
Descr: CString)
returns Boolean;
---Purpose: General method for adding (writing) a validation property
-- for shape which should be already mapped on writing itself.
-- It takes target and Context entities which correspond to shape
-- Returns True if success, False in case of fail
AddArea (me: in out; Shape: Shape from TopoDS; Area: Real)
returns Boolean;
---Purpose: Adds surface area property for given shape (already mapped).
-- Returns True if success, False in case of fail
AddVolume (me: in out; Shape: Shape from TopoDS; Vol: Real)
returns Boolean;
---Purpose: Adds volume property for given shape (already mapped).
-- Returns True if success, False in case of fail
AddCentroid (me: in out; Shape: Shape from TopoDS; Pnt: Pnt from gp;
instance: Boolean = Standard_False)
returns Boolean;
---Purpose: Adds centroid property for given shape (already mapped).
-- Returns True if success, False in case of fail
-- If instance is True, then centroid is assigned to
-- an instance of component in assembly
FindTarget (me: in out; S: Shape from TopoDS;
target: out CharacterizedDefinition from StepRepr;
Context: out RepresentationContext from StepRepr;
instance: Boolean = Standard_False)
returns Boolean;
---Purpose: Finds target STEP entity to which validation props should
-- be assigned, and corresponding context, starting from shape
-- Returns True if success, False in case of fail
LoadProps (me; seq: out SequenceOfTransient from TColStd) returns Boolean;
---Purpose: Searches for entities of the type PropertyDefinitionRepresentation
-- in the model and fills the sequence by them
GetPropNAUO (me; PD: PropertyDefinition from StepRepr)
returns NextAssemblyUsageOccurrence from StepRepr;
---Purpose: Returns CDSR associated with given PpD or NULL if not found
-- (when, try GetPropSDR)
GetPropPD (me; PD: PropertyDefinition from StepRepr)
returns ProductDefinition from StepBasic;
---Purpose: Returns SDR associated with given PpD or NULL if not found
-- (when, try GetPropCDSR)
GetPropShape (me; ProdDef: ProductDefinition from StepBasic)
returns Shape from TopoDS;
---Purpose: Returns Shape associated with given SDR or Null Shape
-- if not found
GetPropShape (me; PD: PropertyDefinition from StepRepr)
returns Shape from TopoDS;
---Purpose: Returns Shape associated with given PpD or Null Shape
-- if not found
GetPropReal (me; item: RepresentationItem from StepRepr;
Val: out Real; isArea: out Boolean)
returns Boolean;
---Purpose: Returns value of Real-Valued property (Area or Volume)
-- If Property is neither Area nor Volume, returns False
-- Else returns True and isArea indicates whether property
-- is area or volume
GetPropPnt (me; item: RepresentationItem from StepRepr;
Context: RepresentationContext from StepRepr;
Pnt: out Pnt from gp)
returns Boolean;
---Purpose: Returns value of Centriod property (or False if it is not)
SetAssemblyShape (me: in out; shape: Shape from TopoDS);
---Purpose: Sets current assembly shape SDR (for FindCDSR calls)
fields
areaUnit, volUnit: Unit from StepBasic; -- units for sharing on writing
myAssemblyPD: ProductDefinition from StepBasic;
end ValidationProps;

View File

@@ -14,63 +14,63 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_ValidationProps.ixx>
#include <STEPConstruct_UnitContext.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <APIHeaderSection_MakeHeader.hxx>
#include <gp_Pnt.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Static.hxx>
#include <Interface_EntityIterator.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <StepBasic_DerivedUnit.hxx>
#include <StepBasic_DerivedUnitElement.hxx>
#include <StepBasic_HArray1OfDerivedUnitElement.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_SiUnitAndAreaUnit.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepBasic_Unit.hxx>
#include <STEPConstruct.hxx>
#include <STEPConstruct_UnitContext.hxx>
#include <STEPConstruct_ValidationProps.hxx>
#include <StepData_StepModel.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
#include <StepGeom_GeometricRepresentationItem.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_GlobalUnitAssignedContext.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_PropertyDefinitionRepresentation.hxx>
#include <StepRepr_RepresentationContext.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepRepr_RepresentationRelationship.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <Transfer_Binder.hxx>
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <TransferBRep.hxx>
#include <TransferBRep_ShapeMapper.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_TransferReader.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Iterator.hxx>
#include <TCollection_HAsciiString.hxx>
#include <APIHeaderSection_MakeHeader.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepGeom_GeometricRepresentationItem.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepRepr_HArray1OfRepresentationItem.hxx>
#include <StepRepr_MeasureRepresentationItem.hxx>
#include <StepRepr_GlobalUnitAssignedContext.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepBasic_SiUnitAndLengthUnit.hxx>
#include <StepBasic_DerivedUnitElement.hxx>
#include <StepBasic_HArray1OfDerivedUnitElement.hxx>
#include <StepBasic_DerivedUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_Unit.hxx>
#include <StepBasic_SiUnitAndAreaUnit.hxx>
#include <StepShape_ContextDependentShapeRepresentation.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <STEPConstruct.hxx>
#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepRepr_PropertyDefinitionRepresentation.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_RepresentationRelationship.hxx>
#include <StepData_StepModel.hxx>
#include <XSControl_TransferWriter.hxx>
#include <XSControl_WorkSession.hxx>
//=======================================================================
//function : STEPConstruct_ValidationProps
//purpose :
//=======================================================================
STEPConstruct_ValidationProps::STEPConstruct_ValidationProps ()
{
}

View File

@@ -0,0 +1,150 @@
// Created on: 1999-09-08
// Created by: Andrey BETENEV
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_ValidationProps_HeaderFile
#define _STEPConstruct_ValidationProps_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <StepBasic_Unit.hxx>
#include <STEPConstruct_Tool.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_Real.hxx>
#include <TColStd_SequenceOfTransient.hxx>
class StepBasic_ProductDefinition;
class XSControl_WorkSession;
class TopoDS_Shape;
class StepRepr_RepresentationItem;
class StepRepr_CharacterizedDefinition;
class StepRepr_RepresentationContext;
class gp_Pnt;
class StepRepr_NextAssemblyUsageOccurrence;
class StepRepr_PropertyDefinition;
//! This class provides tools for access (write and read)
//! the validation properties on shapes in the STEP file.
//! These are surface area, solid volume and centroid.
class STEPConstruct_ValidationProps : public STEPConstruct_Tool
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an empty tool
Standard_EXPORT STEPConstruct_ValidationProps();
//! Creates a tool and loads it with worksession
Standard_EXPORT STEPConstruct_ValidationProps(const Handle(XSControl_WorkSession)& WS);
//! Load worksession; returns True if succeeded
Standard_EXPORT Standard_Boolean Init (const Handle(XSControl_WorkSession)& WS);
//! General method for adding (writing) a validation property
//! for shape which should be already mapped on writing itself.
//! It uses FindTarget() to find target STEP entity
//! resulting from given shape, and associated context
//! Returns True if success, False in case of fail
Standard_EXPORT Standard_Boolean AddProp (const TopoDS_Shape& Shape, const Handle(StepRepr_RepresentationItem)& Prop, const Standard_CString Descr, const Standard_Boolean instance = Standard_False);
//! General method for adding (writing) a validation property
//! for shape which should be already mapped on writing itself.
//! It takes target and Context entities which correspond to shape
//! Returns True if success, False in case of fail
Standard_EXPORT Standard_Boolean AddProp (const StepRepr_CharacterizedDefinition& target, const Handle(StepRepr_RepresentationContext)& Context, const Handle(StepRepr_RepresentationItem)& Prop, const Standard_CString Descr);
//! Adds surface area property for given shape (already mapped).
//! Returns True if success, False in case of fail
Standard_EXPORT Standard_Boolean AddArea (const TopoDS_Shape& Shape, const Standard_Real Area);
//! Adds volume property for given shape (already mapped).
//! Returns True if success, False in case of fail
Standard_EXPORT Standard_Boolean AddVolume (const TopoDS_Shape& Shape, const Standard_Real Vol);
//! Adds centroid property for given shape (already mapped).
//! Returns True if success, False in case of fail
//! If instance is True, then centroid is assigned to
//! an instance of component in assembly
Standard_EXPORT Standard_Boolean AddCentroid (const TopoDS_Shape& Shape, const gp_Pnt& Pnt, const Standard_Boolean instance = Standard_False);
//! Finds target STEP entity to which validation props should
//! be assigned, and corresponding context, starting from shape
//! Returns True if success, False in case of fail
Standard_EXPORT Standard_Boolean FindTarget (const TopoDS_Shape& S, StepRepr_CharacterizedDefinition& target, Handle(StepRepr_RepresentationContext)& Context, const Standard_Boolean instance = Standard_False);
//! Searches for entities of the type PropertyDefinitionRepresentation
//! in the model and fills the sequence by them
Standard_EXPORT Standard_Boolean LoadProps (TColStd_SequenceOfTransient& seq) const;
//! Returns CDSR associated with given PpD or NULL if not found
//! (when, try GetPropSDR)
Standard_EXPORT Handle(StepRepr_NextAssemblyUsageOccurrence) GetPropNAUO (const Handle(StepRepr_PropertyDefinition)& PD) const;
//! Returns SDR associated with given PpD or NULL if not found
//! (when, try GetPropCDSR)
Standard_EXPORT Handle(StepBasic_ProductDefinition) GetPropPD (const Handle(StepRepr_PropertyDefinition)& PD) const;
//! Returns Shape associated with given SDR or Null Shape
//! if not found
Standard_EXPORT TopoDS_Shape GetPropShape (const Handle(StepBasic_ProductDefinition)& ProdDef) const;
//! Returns Shape associated with given PpD or Null Shape
//! if not found
Standard_EXPORT TopoDS_Shape GetPropShape (const Handle(StepRepr_PropertyDefinition)& PD) const;
//! Returns value of Real-Valued property (Area or Volume)
//! If Property is neither Area nor Volume, returns False
//! Else returns True and isArea indicates whether property
//! is area or volume
Standard_EXPORT Standard_Boolean GetPropReal (const Handle(StepRepr_RepresentationItem)& item, Standard_Real& Val, Standard_Boolean& isArea) const;
//! Returns value of Centriod property (or False if it is not)
Standard_EXPORT Standard_Boolean GetPropPnt (const Handle(StepRepr_RepresentationItem)& item, const Handle(StepRepr_RepresentationContext)& Context, gp_Pnt& Pnt) const;
//! Sets current assembly shape SDR (for FindCDSR calls)
Standard_EXPORT void SetAssemblyShape (const TopoDS_Shape& shape);
protected:
private:
StepBasic_Unit areaUnit;
StepBasic_Unit volUnit;
Handle(StepBasic_ProductDefinition) myAssemblyPD;
};
#endif // _STEPConstruct_ValidationProps_HeaderFile