mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024734: Convertation of the generic classes to the non-generic. Part 4
Generic classes "LProp_FuncCurExt", "LProp_FuncCurNul" and "LProp_NumericCurInf" from "LProp" package converted to the non-generic classes and moved to the "Geom2dLProp" package. Therefore names of this classes were changed to "Geom2dLProp_FuncCurExt", "Geom2dLProp_FuncCurNul" and "Geom2dLProp_NumericCurInf". Generic class "Sweep_LinearRegularSweep" from "Sweep" package converted to the non-generic classes and moved to the "BRepSweep" package. Therefore name of this class was changed to "BRepSweep_NumLinearRegularSweep". Also 2 internal classes of "BRepSweep_NumLinearRegularSweep" moved to "BRepSweep.cdl". Generic classes "Primitives_Wedge" and "Primitives_OneAxis" from "Primitives" package converted to the non-generic classes and moved to the "BRepPrim" package. Therefore names of this classes were changed to "BRepPrim_GWedge" and "BRepPrim_OneAxis". Also enum "Direction" moved to BRepPrim. Therefore all "Primitives" package was deleted. And some other minor changes were done. Internal classes Array2OfShapes and SequenceOfShapes from BRepSweep_NumLinearRegularSweep replaced to Array2OfShape and SequenceOfShape from TopTools.
This commit is contained in:
@@ -28,11 +28,6 @@ uses
|
||||
|
||||
is
|
||||
|
||||
deferred generic class LinearRegularSweep,
|
||||
Array2OfShapes,
|
||||
SequenceOfShapes;
|
||||
|
||||
|
||||
--
|
||||
-- The following classes provides a directing topology for the
|
||||
-- LinearRegularSweep. This is the topology of an open or
|
||||
|
@@ -1,363 +0,0 @@
|
||||
-- Created on: 1993-01-27
|
||||
-- Created by: Philippe DAUTRY
|
||||
-- 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.
|
||||
|
||||
deferred generic class LinearRegularSweep from Sweep (
|
||||
TheShape as any; -- resulting topological objects.
|
||||
TheGenShape as any; -- Generating topological objects.
|
||||
TheDirShape as any; -- Directing topological objects.
|
||||
TheBuilder as any;
|
||||
TheGenShapeTool as any;
|
||||
TheDirShapeTool as any;
|
||||
TheShapeIterator as any;
|
||||
TheGenShapeIterator as any;
|
||||
TheDirShapeIterator as any)
|
||||
|
||||
|
||||
---Purpose: This a generic class is used to build Sweept
|
||||
-- primitives with a generating "shape" and a
|
||||
-- directing "line".
|
||||
--
|
||||
-- The indexation and type analysis services required
|
||||
-- for the generatrix are given by <TheGenShapeTool>.
|
||||
--
|
||||
-- The indexation and type analysis services required
|
||||
-- for the directrix are given by <TheDirShapeTool>.
|
||||
--
|
||||
-- The iteration services required for the generatrix
|
||||
-- are given by <TheGenShapeIterator>.
|
||||
--
|
||||
-- The iteration services required for the directrix
|
||||
-- are given by <TheDirShapeIterator>.
|
||||
--
|
||||
-- The topology is like a grid of shapes. Each shape
|
||||
-- of the grid must be addressable without confusion
|
||||
-- by one or two objects from the generating or
|
||||
-- directing shapes. Here are exemples of correct
|
||||
-- associations to address:
|
||||
--
|
||||
-- - a vertex : GenVertex - DirVertex
|
||||
-- - an edge : GenVertex - DirEdge
|
||||
-- - : GenEdge - DirVertex
|
||||
-- - a face : GenEdge - DirEdge
|
||||
-- GenFace - DirVertex
|
||||
-- ...
|
||||
--
|
||||
-- "GenObject" is used to identify an object from the
|
||||
-- Generating Shape, and "DirObject" from the
|
||||
-- Directing Shape. So may they be from different
|
||||
-- types.
|
||||
--
|
||||
-- The method Has... is given because in some special
|
||||
-- cases, a vertex, an edge or a face may be
|
||||
-- geometricaly nonexistant or not usefull.
|
||||
|
||||
uses
|
||||
|
||||
Orientation from TopAbs,
|
||||
Array2OfBoolean from TColStd
|
||||
|
||||
raises
|
||||
|
||||
NoMoreObject from Standard,
|
||||
NoSuchObject from Standard,
|
||||
RangeError from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
-- Nested classes
|
||||
|
||||
class Array2OfShapes
|
||||
instantiates Array2 from TCollection (TheShape);
|
||||
class SequenceOfShapes
|
||||
instantiates Sequence from TCollection (TheShape);
|
||||
|
||||
is
|
||||
|
||||
|
||||
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
Delete(me:out) is virtual ;
|
||||
---C++: alias ~
|
||||
|
||||
Initialize(aBuilder : TheBuilder;
|
||||
aGenShape : TheGenShape;
|
||||
aDirWire : TheDirShape);
|
||||
---Purpose: Creates a LinearRegularSweep. <aBuilder> gives
|
||||
-- basic topological services.
|
||||
|
||||
|
||||
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
-- Deferred Methods supporting the creation of the geometric part.
|
||||
|
||||
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
MakeEmptyVertex(me : in out; aGenV: TheGenShape; aDirV: TheDirShape)
|
||||
returns TheShape
|
||||
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
|
||||
-- geometric part, but without subcomponents.
|
||||
is deferred;
|
||||
|
||||
MakeEmptyDirectingEdge(me: in out; aGenV: TheGenShape; aDirE: TheDirShape)
|
||||
returns TheShape
|
||||
---Purpose: Builds the edge addressed by [aGenV,aDirE], with its
|
||||
-- geometric part, but without subcomponents.
|
||||
is deferred;
|
||||
|
||||
MakeEmptyGeneratingEdge(me: in out; aGenE: TheGenShape; aDirV: TheDirShape)
|
||||
returns TheShape
|
||||
---Purpose: Builds the edge addressed by [aGenE,aDirV], with its
|
||||
-- geometric part, but without subcomponents.
|
||||
is deferred;
|
||||
|
||||
SetParameters(me : in out;
|
||||
aNewFace : TheShape;
|
||||
aNewVertex : in out TheShape;
|
||||
aGenF : TheGenShape;
|
||||
aGenV : TheGenShape;
|
||||
aDirV : TheDirShape)
|
||||
---Purpose: Sets the parameters of the new vertex on the new
|
||||
-- face. The new face and new vertex where generated
|
||||
-- from aGenF, aGenV and aDirV .
|
||||
is deferred;
|
||||
|
||||
SetDirectingParameter(me : in out;
|
||||
aNewEdge : TheShape;
|
||||
aNewVertex : in out TheShape;
|
||||
aGenV : TheGenShape;
|
||||
aDirE : TheDirShape;
|
||||
aDirV : TheDirShape)
|
||||
---Purpose: Sets the parameter of the new vertex on the new
|
||||
-- edge. The new edge and new vertex where generated
|
||||
-- from aGenV aDirE, and aDirV.
|
||||
is deferred;
|
||||
|
||||
SetGeneratingParameter(me : in out;
|
||||
aNewEdge : TheShape;
|
||||
aNewVertex : in out TheShape;
|
||||
aGenE : TheGenShape;
|
||||
aGenV : TheGenShape;
|
||||
aDirV : TheDirShape)
|
||||
---Purpose: Sets the parameter of the new vertex on the new
|
||||
-- edge. The new edge and new vertex where generated
|
||||
-- from aGenE, aGenV and aDirV .
|
||||
is deferred;
|
||||
|
||||
MakeEmptyFace(me : in out;
|
||||
aGenS : TheGenShape;
|
||||
aDirS : TheDirShape)
|
||||
returns TheShape
|
||||
---Purpose: Builds the face addressed by [aGenS,aDirS], with
|
||||
-- its geometric part, but without subcomponents. The
|
||||
-- couple aGenS, aDirS can be a "generating face and
|
||||
-- a directing vertex" or "a generating edge and a
|
||||
-- directing edge".
|
||||
is deferred;
|
||||
|
||||
SetPCurve(me : in out;
|
||||
aNewFace : TheShape;
|
||||
aNewEdge : in out TheShape;
|
||||
aGenF : TheGenShape;
|
||||
aGenE : TheGenShape;
|
||||
aDirV : TheDirShape;
|
||||
orien : Orientation from TopAbs)
|
||||
---Purpose: Sets the PCurve for a new edge on a new face. The
|
||||
-- new edge and the new face were generated using
|
||||
-- aGenF, aGenE and aDirV.
|
||||
is deferred;
|
||||
|
||||
SetGeneratingPCurve(me : in out;
|
||||
aNewFace : TheShape;
|
||||
aNewEdge : in out TheShape;
|
||||
aGenE : TheGenShape;
|
||||
aDirE : TheDirShape;
|
||||
aDirV : TheDirShape;
|
||||
orien : Orientation from TopAbs)
|
||||
|
||||
---Purpose: Sets the PCurve for a new edge on a new face. The
|
||||
-- new edge and the new face were generated using
|
||||
-- aGenE, aDirE and aDirV.
|
||||
is deferred;
|
||||
|
||||
SetDirectingPCurve(me : in out;
|
||||
aNewFace : TheShape;
|
||||
aNewEdge : in out TheShape;
|
||||
aGenE : TheGenShape;
|
||||
aGenV : TheGenShape;
|
||||
aDirE : TheDirShape;
|
||||
orien : Orientation from TopAbs)
|
||||
|
||||
---Purpose: Sets the PCurve for a new edge on a new face. The
|
||||
-- new edge and the new face were generated using
|
||||
-- aGenE, aDirE and aGenV.
|
||||
is deferred;
|
||||
|
||||
DirectSolid(me : in out;
|
||||
aGenS : TheGenShape;
|
||||
aDirS : TheDirShape)
|
||||
returns Orientation from TopAbs
|
||||
---Purpose: Returns the Orientation of the shell in the solid
|
||||
-- generated by the face aGenS with the edge aDirS.
|
||||
-- It is REVERSED if the surface is swept in the
|
||||
-- direction of the normal.
|
||||
is deferred;
|
||||
|
||||
GGDShapeIsToAdd (me;
|
||||
aNewShape : TheShape;
|
||||
aNewSubShape : TheShape;
|
||||
aGenS : TheGenShape;
|
||||
aSubGenS : TheGenShape;
|
||||
aDirS : TheDirShape)
|
||||
returns Boolean from Standard
|
||||
---Purpose: Returns true if aNewSubShape (addressed by
|
||||
-- aSubGenS and aDirS) must be added in aNewShape
|
||||
-- (addressed by aGenS and aDirS).
|
||||
is deferred;
|
||||
|
||||
GDDShapeIsToAdd (me;
|
||||
aNewShape : TheShape;
|
||||
aNewSubShape : TheShape;
|
||||
aGenS : TheGenShape;
|
||||
aDirS : TheDirShape;
|
||||
aSubDirS : TheDirShape)
|
||||
returns Boolean from Standard
|
||||
---Purpose: Returns true if aNewSubShape (addressed by
|
||||
-- aGenS and aSubDirS) must be added in aNewShape
|
||||
-- (addressed by aGenS and aDirS).
|
||||
is deferred;
|
||||
|
||||
|
||||
SeparatedWires (me;
|
||||
aNewShape : TheShape;
|
||||
aNewSubShape : TheShape;
|
||||
aGenS : TheGenShape;
|
||||
aSubGenS : TheGenShape;
|
||||
aDirS : TheDirShape)
|
||||
returns Boolean from Standard
|
||||
---Purpose: In some particular cases the topology of a
|
||||
-- generated face must be composed of independant
|
||||
-- closed wires, in this case this function returns
|
||||
-- true.
|
||||
is deferred;
|
||||
|
||||
|
||||
SplitShell (me; aNewShape : TheShape)
|
||||
returns TheShape
|
||||
---Purpose: In some particular cases the topology of a
|
||||
-- generated Shell must be composed of independant
|
||||
-- closed Shells, in this case this function returns
|
||||
-- a Compound of independant Shells.
|
||||
is virtual;
|
||||
|
||||
|
||||
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
-- Method coding the continuities on the edges between 2 faces
|
||||
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
SetContinuity(me : in out; aGenS : TheGenShape; aDirS : TheDirShape)
|
||||
---Purpose: Called to propagate the continuity of every vertex
|
||||
-- between two edges of the generating wire aGenS on
|
||||
-- the generated edge and faces.
|
||||
is deferred;
|
||||
|
||||
|
||||
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
-- User end methods.
|
||||
--
|
||||
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
-- Shapes
|
||||
-- """"""
|
||||
|
||||
HasShape(me; aGenS : TheGenShape; aDirS : TheDirShape)
|
||||
returns Boolean from Standard
|
||||
---Purpose: Returns true if aDirS and aGenS addresses a
|
||||
-- resulting Shape. In some specific cases the shape
|
||||
-- can be geometrically inexsistant, then this
|
||||
-- function returns false.
|
||||
is deferred;
|
||||
|
||||
Shape(me: in out; aGenS : TheGenShape; aDirS : TheDirShape)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by aDirS and
|
||||
-- aGenS.
|
||||
is static;
|
||||
|
||||
|
||||
Shape(me: in out; aGenS : TheGenShape)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by myDirWire
|
||||
-- and aGenS.
|
||||
is static;
|
||||
|
||||
Shape(me: in out)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by myDirWire
|
||||
-- and myGenShape.
|
||||
is static;
|
||||
|
||||
FirstShape(me: in out)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by the first
|
||||
-- Vertex of myDirWire and myGenShape.
|
||||
is static;
|
||||
|
||||
LastShape(me: in out)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by the last
|
||||
-- Vertex of myDirWire and myGenShape.
|
||||
is static;
|
||||
|
||||
|
||||
FirstShape(me: in out; aGenS : TheGenShape)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by the first
|
||||
-- Vertex of myDirWire and aGenS.
|
||||
is static;
|
||||
|
||||
LastShape(me: in out; aGenS : TheGenShape)
|
||||
returns TheShape
|
||||
---Purpose: Returns the resulting Shape indexed by the last
|
||||
-- Vertex of myDirWire and aGenS.
|
||||
is static;
|
||||
|
||||
|
||||
Closed(me) returns Boolean from Standard is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
-- Topology builder.
|
||||
|
||||
myBuilder : TheBuilder is protected;
|
||||
|
||||
-- Generating shape
|
||||
|
||||
myGenShape : TheGenShape is protected;
|
||||
|
||||
-- Directing line
|
||||
|
||||
myDirWire : TheDirShape is protected;
|
||||
|
||||
-- shape tools.
|
||||
|
||||
myGenShapeTool : TheGenShapeTool is protected;
|
||||
myDirShapeTool : TheDirShapeTool is protected;
|
||||
|
||||
-- Array of built objects (NbGShapes,NbDShapes).
|
||||
myShapes : Array2OfShapes is protected;
|
||||
|
||||
-- Array of built objects flags (NbGShapes,NbDShapes).
|
||||
myBuiltShapes : Array2OfBoolean from TColStd is protected;
|
||||
|
||||
end LinearRegularSweep;
|
@@ -1,473 +0,0 @@
|
||||
// Created on: 1992-07-02
|
||||
// Created by: Philippe DAUTRY
|
||||
// Copyright (c) 1992-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.
|
||||
|
||||
#include <Standard_RangeError.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Sweep_LinearRegularSweep
|
||||
//purpose : Create a Regular Sweep.
|
||||
//=======================================================================
|
||||
|
||||
Sweep_LinearRegularSweep::Sweep_LinearRegularSweep
|
||||
(const TheBuilder& aBuilder,
|
||||
const TheGenShape& aGenShape,
|
||||
const TheDirShape& aDirShape):
|
||||
|
||||
myBuilder(aBuilder),
|
||||
myGenShape(aGenShape),
|
||||
myDirWire(aDirShape),
|
||||
|
||||
myGenShapeTool(aGenShape),
|
||||
myDirShapeTool(aDirShape),
|
||||
|
||||
// *****************************************************************
|
||||
// Les Tableaux
|
||||
// *****************************************************************
|
||||
|
||||
myShapes(1,myGenShapeTool.NbShapes(),
|
||||
1,myDirShapeTool.NbShapes()),
|
||||
myBuiltShapes(1,myGenShapeTool.NbShapes(),
|
||||
1,myDirShapeTool.NbShapes())
|
||||
{
|
||||
myBuiltShapes.Init(Standard_False);
|
||||
}
|
||||
|
||||
void Sweep_LinearRegularSweep::Delete()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose : Returns the global Shape.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::Shape ()
|
||||
{
|
||||
if (HasShape(myGenShape,myDirWire)) return Shape(myGenShape,myDirWire);
|
||||
else {
|
||||
TheShape bidon;
|
||||
return bidon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose : Returns the Shape generated with aGenS.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS)
|
||||
{
|
||||
if (myGenShapeTool.Index(aGenS) != 0 &&
|
||||
HasShape(aGenS,myDirWire)) return Shape(aGenS,myDirWire);
|
||||
else {
|
||||
TheShape bidon;
|
||||
return bidon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose : Returns the Shape indexed by the arguments.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS,
|
||||
const TheDirShape& aDirS)
|
||||
{
|
||||
Standard_Integer iGenS = myGenShapeTool.Index(aGenS);
|
||||
Standard_Integer iDirS = myDirShapeTool.Index(aDirS);
|
||||
if (!myBuiltShapes(iGenS,iDirS)){
|
||||
TheShape newShape;
|
||||
TheGenShape bGenS,cGenS,subGenS,subsubGenS;
|
||||
TheDirShape bDirS,subDirS;
|
||||
TheGenShapeIterator It;
|
||||
TheDirShapeIterator Kt;
|
||||
TheShapeIterator Lt;
|
||||
TopAbs_Orientation Or,Pr;
|
||||
if (myDirShapeTool.Type(aDirS)==TopAbs_VERTEX){
|
||||
//Ici on construit les "planchers" du Shape.
|
||||
TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS);
|
||||
switch (aGenSType){
|
||||
case TopAbs_VERTEX :
|
||||
myShapes(iGenS,iDirS)=MakeEmptyVertex(aGenS,aDirS);
|
||||
break;
|
||||
case TopAbs_EDGE :
|
||||
myShapes(iGenS,iDirS)=MakeEmptyGeneratingEdge(aGenS,aDirS);
|
||||
break;
|
||||
case TopAbs_WIRE :
|
||||
myBuilder.MakeWire(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_FACE :
|
||||
myShapes(iGenS,iDirS)=MakeEmptyFace(aGenS,aDirS);
|
||||
break;
|
||||
case TopAbs_SHELL :
|
||||
myBuilder.MakeShell(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_SOLID :
|
||||
Standard_NoSuchObject::Raise("Solids are not Processed");
|
||||
break;
|
||||
case TopAbs_COMPSOLID :
|
||||
Standard_NoSuchObject::Raise("Solids are not Processed");
|
||||
break;
|
||||
case TopAbs_COMPOUND :
|
||||
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
default:
|
||||
Standard_NoSuchObject::Raise("Unknown Shape");
|
||||
break;
|
||||
}
|
||||
bGenS = aGenS;
|
||||
myGenShapeTool.SetOrientation(bGenS,TopAbs_FORWARD);
|
||||
for (It.Init(bGenS);It.More();It.Next()){
|
||||
subGenS = It.Value();
|
||||
Or = It.Orientation();
|
||||
if(HasShape(subGenS,aDirS)){
|
||||
newShape = Shape(subGenS,aDirS);
|
||||
if (GGDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
|
||||
aGenS,subGenS,aDirS)){
|
||||
//Les "planchers" doivent etre construits par les
|
||||
//fonctions de construcion geometrique identiquement
|
||||
//au shape generateur.
|
||||
//On leur recolle juste une orientation pour etre bien
|
||||
//sur.
|
||||
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
TopAbs_ShapeEnum subGenSType = myGenShapeTool.Type(subGenS);
|
||||
if (aGenSType==TopAbs_FACE){
|
||||
if(subGenSType==TopAbs_VERTEX){
|
||||
SetParameters(myShapes(iGenS,iDirS),
|
||||
newShape,aGenS,subGenS,aDirS);
|
||||
}
|
||||
else if(subGenSType==TopAbs_EDGE){
|
||||
SetPCurve(myShapes(iGenS,iDirS),newShape,
|
||||
aGenS,subGenS,aDirS,Or);
|
||||
}
|
||||
else if(subGenSType==TopAbs_WIRE){
|
||||
TheGenShapeIterator Jt;
|
||||
cGenS = subGenS;
|
||||
myGenShapeTool.SetOrientation(cGenS,TopAbs_FORWARD);
|
||||
for (Jt.Init(cGenS);Jt.More();Jt.Next()){
|
||||
subsubGenS = Jt.Value();
|
||||
Pr = Jt.Orientation();
|
||||
if(HasShape(subsubGenS,aDirS)){
|
||||
TheShape newsubEdge = Shape(subsubGenS,aDirS);
|
||||
SetPCurve(myShapes(iGenS,iDirS),newsubEdge,
|
||||
aGenS,subsubGenS,aDirS,Pr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(aGenSType==TopAbs_EDGE){
|
||||
SetGeneratingParameter(myShapes(iGenS,iDirS),
|
||||
newShape,bGenS,subGenS,aDirS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (myDirShapeTool.Type(aDirS)==TopAbs_EDGE){
|
||||
//Ici on construit les murs du Shape.
|
||||
TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS);
|
||||
TheShape newWire,newShell;
|
||||
Sweep_SequenceOfShapes WireSeq;
|
||||
Standard_Boolean sepwires = Standard_False;
|
||||
switch (aGenSType){
|
||||
case TopAbs_VERTEX :
|
||||
myShapes(iGenS,iDirS)=MakeEmptyDirectingEdge(aGenS,aDirS);
|
||||
break;
|
||||
case TopAbs_EDGE :
|
||||
//On cree un wire intermediaire qui contient tous les edges
|
||||
//du montant (face) du Shape pour le cas standard, et une
|
||||
//sequence de wires pour les cas merdiques necessitant des
|
||||
//wires independants.
|
||||
myBuilder.MakeWire(newWire);
|
||||
myShapes(iGenS,iDirS)=MakeEmptyFace(aGenS,aDirS);
|
||||
break;
|
||||
case TopAbs_WIRE :
|
||||
myBuilder.MakeShell(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_FACE :
|
||||
//On cree un shell intermediaire dans lequel on jette toutes
|
||||
//les faces en direct, pour eviter les empilages compliques
|
||||
//de shells et sous shells dans la structure du solide.
|
||||
myBuilder.MakeShell(newShell);
|
||||
myBuilder.MakeSolid(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_SHELL :
|
||||
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_SOLID :
|
||||
Standard_NoSuchObject::Raise("Solids are not Processed");
|
||||
break;
|
||||
case TopAbs_COMPSOLID :
|
||||
Standard_NoSuchObject::Raise("Solids are not Processed");
|
||||
break;
|
||||
case TopAbs_COMPOUND :
|
||||
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
default:
|
||||
Standard_NoSuchObject::Raise("Unknown Shape");
|
||||
break;
|
||||
}
|
||||
bGenS = aGenS;
|
||||
myGenShapeTool.SetOrientation(bGenS,TopAbs_FORWARD);
|
||||
for (It.Init(bGenS);It.More();It.Next()){
|
||||
subGenS = It.Value();
|
||||
if(HasShape(subGenS,aDirS)){
|
||||
newShape = Shape(subGenS,aDirS);
|
||||
if (GGDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
|
||||
aGenS,subGenS,aDirS)){
|
||||
TopAbs_ShapeEnum subGenSType = myGenShapeTool.Type(subGenS);
|
||||
if (aGenSType==TopAbs_EDGE){
|
||||
Or = It.Orientation();
|
||||
if (SeparatedWires(myShapes(iGenS,iDirS),newShape,
|
||||
aGenS,subGenS,aDirS)){
|
||||
sepwires = Standard_True;
|
||||
TheShape wi;
|
||||
myBuilder.MakeWire(wi);
|
||||
myBuilder.Add(wi,newShape,Or);
|
||||
WireSeq.Append(wi);
|
||||
}
|
||||
else{
|
||||
myBuilder.Add(newWire,newShape,Or);
|
||||
}
|
||||
SetDirectingPCurve (myShapes(iGenS,iDirS),
|
||||
newShape,bGenS,subGenS,aDirS,Or);
|
||||
}
|
||||
else if (aGenSType==TopAbs_WIRE){
|
||||
Or = It.Orientation();
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
}
|
||||
else if (aGenSType==TopAbs_FACE){
|
||||
Or = It.Orientation();
|
||||
if(subGenSType == TopAbs_WIRE) {
|
||||
for (Lt.Init(newShape);Lt.More();Lt.Next()){
|
||||
myBuilder.Add(newShell,Lt.Value(),
|
||||
TopAbs::Compose(Lt.Orientation(),Or));
|
||||
}
|
||||
}
|
||||
else if(subGenSType == TopAbs_EDGE) {
|
||||
myBuilder.Add(newShell,newShape,Or);
|
||||
}
|
||||
}
|
||||
else if(aGenSType == TopAbs_SHELL){
|
||||
Or = TopAbs_FORWARD;
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
}
|
||||
else if(aGenSType == TopAbs_COMPOUND){
|
||||
Or = TopAbs_FORWARD;
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
}
|
||||
else{
|
||||
Or = It.Orientation();
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bDirS = aDirS;
|
||||
for (Kt.Init(bDirS);Kt.More();Kt.Next()){
|
||||
subDirS = Kt.Value();
|
||||
if(HasShape(aGenS,subDirS)){
|
||||
newShape = Shape(aGenS,subDirS);
|
||||
if (GDDShapeIsToAdd(myShapes(iGenS,iDirS),newShape,
|
||||
aGenS,aDirS,subDirS)){
|
||||
if (aGenSType==TopAbs_EDGE){
|
||||
Or = TopAbs::Reverse(Kt.Orientation());
|
||||
myBuilder.Add(newWire,newShape,Or);
|
||||
SetGeneratingPCurve
|
||||
(myShapes(iGenS,iDirS),newShape,aGenS,aDirS,subDirS,Or);
|
||||
}
|
||||
else if(aGenSType==TopAbs_VERTEX){
|
||||
Or = Kt.Orientation();
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
SetDirectingParameter
|
||||
(myShapes(iGenS,iDirS),newShape,aGenS,aDirS,subDirS);
|
||||
}
|
||||
else if(aGenSType==TopAbs_FACE){
|
||||
Or = Kt.Orientation();
|
||||
myBuilder.Add(newShell,newShape,Or);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aGenSType==TopAbs_EDGE){
|
||||
if (sepwires){
|
||||
for(Standard_Integer ij = 1;ij <= WireSeq.Length();ij++){
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),WireSeq.Value(ij));
|
||||
}
|
||||
}
|
||||
else{
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newWire);
|
||||
}
|
||||
myBuiltShapes(iGenS,iDirS) = Standard_True;
|
||||
SetContinuity(aGenS,aDirS);
|
||||
}
|
||||
if (aGenSType==TopAbs_WIRE){
|
||||
SetContinuity(aGenS,aDirS);
|
||||
}
|
||||
if (aGenSType==TopAbs_FACE){
|
||||
TheShape temp = SplitShell(newShell);
|
||||
TopAbs_Orientation Or = DirectSolid(aGenS,aDirS);
|
||||
Lt.Init(temp);
|
||||
if(Lt.More()) Lt.Next();
|
||||
if(Lt.More()){
|
||||
for (Lt.Init(temp);Lt.More();Lt.Next()){
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),Lt.Value(),Or);
|
||||
}
|
||||
}
|
||||
else myBuilder.Add(myShapes(iGenS,iDirS),newShell,Or);
|
||||
}
|
||||
}
|
||||
else if (myDirShapeTool.Type(aDirS)==TopAbs_WIRE){
|
||||
TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS);
|
||||
switch (aGenSType){
|
||||
case TopAbs_VERTEX :
|
||||
myBuilder.MakeWire(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_EDGE :
|
||||
myBuilder.MakeShell(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_WIRE :
|
||||
myBuilder.MakeShell(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_FACE :
|
||||
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_SHELL :
|
||||
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
case TopAbs_SOLID :
|
||||
Standard_NoSuchObject::Raise("Solids are not Processed");
|
||||
break;
|
||||
case TopAbs_COMPSOLID :
|
||||
Standard_NoSuchObject::Raise("Solids are not Processed");
|
||||
break;
|
||||
case TopAbs_COMPOUND :
|
||||
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
|
||||
break;
|
||||
default:
|
||||
Standard_NoSuchObject::Raise("Unknown Shape");
|
||||
break;
|
||||
}
|
||||
bDirS = aDirS;
|
||||
for (Kt.Init(aDirS);Kt.More();Kt.Next()){
|
||||
subDirS = Kt.Value();
|
||||
if(HasShape(aGenS,subDirS)){
|
||||
Or = Kt.Orientation();
|
||||
newShape = Shape(aGenS,subDirS);
|
||||
myBuilder.Add(myShapes(iGenS,iDirS),newShape,Or);
|
||||
}
|
||||
}
|
||||
}
|
||||
myBuiltShapes(iGenS,iDirS) = Standard_True;
|
||||
}
|
||||
return myShapes(iGenS,iDirS);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstShape
|
||||
//purpose : Returns the Shape indexed by the arguments.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::FirstShape ()
|
||||
{
|
||||
TheShape result;
|
||||
if (myDirShapeTool.HasFirstVertex()){
|
||||
if(HasShape(myGenShape,myDirShapeTool.FirstVertex()))
|
||||
result = Shape(myGenShape,myDirShapeTool.FirstVertex());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastShape
|
||||
//purpose : Returns the Shape indexed by the arguments.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::LastShape ()
|
||||
{
|
||||
TheShape result;
|
||||
if (myDirShapeTool.HasLastVertex()){
|
||||
if(HasShape(myGenShape,myDirShapeTool.LastVertex()))
|
||||
result = Shape(myGenShape,myDirShapeTool.LastVertex());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstShape
|
||||
//purpose : Returns the Shape indexed by the arguments.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::FirstShape (const TheGenShape& aGenS)
|
||||
{
|
||||
TheShape result;
|
||||
if (myDirShapeTool.HasFirstVertex()){
|
||||
if(HasShape(aGenS,myDirShapeTool.FirstVertex()))
|
||||
result = Shape(aGenS,myDirShapeTool.FirstVertex());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastShape
|
||||
//purpose : Returns the Shape indexed by the arguments.
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::LastShape (const TheGenShape& aGenS)
|
||||
{
|
||||
TheShape result;
|
||||
if (myDirShapeTool.HasLastVertex()){
|
||||
if(HasShape(aGenS,myDirShapeTool.LastVertex()))
|
||||
result = Shape(aGenS,myDirShapeTool.LastVertex());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Closed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Sweep_LinearRegularSweep::Closed()const
|
||||
{
|
||||
return myDirWire.Closed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SplitShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TheShape Sweep_LinearRegularSweep::SplitShell(const TheShape& aNewShape)const
|
||||
{
|
||||
TheShape comp;
|
||||
myBuilder.MakeCompound(comp);
|
||||
myBuilder.Add(comp,aNewShape);
|
||||
return comp;
|
||||
}
|
||||
|
Reference in New Issue
Block a user