1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

..

28 Commits

Author SHA1 Message Date
hossamali
6654b12d6e 0033731: Visualization - Transparent background for rendered image files
- add flag to 3D view dump for removing background based color keying.
- add color keying function to Image_PixMap
2024-06-06 15:05:09 +00:00
ika
f55b04c09c 0033634: Data Exchange, Step Import - Multithreading Step processing
- add parallel execution on the level of STEPControl_ActorRead. Sending simple shapes for healing in parallel;
- add parameter to turn ON/OFF this behavior read.step.parallel.healing, ON by default.
2024-05-16 12:39:46 +01:00
dpasukhi
49d628667b 0033099: Data Exchange, Step Import - Wrong PMI values in GDT
measure_with_unit entity is changed to be translated as Handle(Standard_Transient) and to be processed later, depending on the underlying type being used.
2024-05-15 16:24:33 +01:00
dpasukhi
700ba20c7b 0033206: Data Exchange, Step - Supplemental geometry support
Update initial visible status of SupplementalGeometry to visible.
To update this value on API side after, you need to found a free label
  contains attribute "XCAFDoc::SupplementalContainerGUID()" and set invisible attribute
  XCAFDoc::InvisibleGUID()
2024-05-14 15:31:27 +01:00
mzernova
f67b0c9fec Werth 606: Import of STEP file crashes at the very end when visualizing the boundary curves.
When an edge (BRepMeshData_Edge) has multiple PCurve curves (IMeshData_PCurve) with different orientations, the index array is filled for only one PCurve curve.
This would cause problems later, so a fix was made to fill index arrays for curves with another orientation.
2024-05-14 15:28:31 +01:00
ika
8573cc5994 * 0033273: Data Exchange, GDT - Getting number of multiple elements with the same measure
Updated DimTolTool API to get number of multiple elements with the same measure.
2024-05-14 15:26:59 +01:00
ika
b8a8da98e4 0033206: Data Exchange, Step - Supplemental geometry support
Updated import methods to add supplemental geometry as a reference to the PMI
Updated export methods to handle supplemental geometry as a special type.
Created new GUID for supplemental geometry container - compound contains all sup. geom. shapes.
Created new GUID for supplemental geometry label - supplemental geometry shape.
Created new GUID for supplemental geometry reference - relation for depends on.
Supplemental geometry: surfaces and curves.
2024-05-14 15:19:54 +01:00
dpasukhi
dd306ad971 Data Exchange, Step Import - Incorrect computing of PMI text location
Fixed problem with too large box of the representation. In this case incorrect annotation plane is used as internal location.
2024-05-13 13:00:32 +01:00
jgv
052d06b301 Fix of regression in Extrema, improvement in 3D offset. 2024-05-13 12:07:17 +01:00
dpasukhi
bd2a789f15 Update version to 7.8.1 2024-03-31 23:05:22 +01:00
dpasukhi
a4e91f855b 0033656: Foundation Classes - Standard_Type crash during unloading static lib
Revert changes to use type_info as a key to use string.
Impact - performance decrease to search (once per class registration)
Will be updated with reorganizing type storage in future
2024-03-31 23:05:22 +01:00
oan
9efc032b9a 0033560: PARASOLID Import - XT importer raises exception SIGFPE Arithmetic Exception
Prevent division by zero in exceptional cases when vector of parameters contains only a single value.
2024-03-31 22:46:06 +01:00
ichesnok
44cbb3d8e7 0033410: Data Exchange, Step Import - TRIANGULATED_FACE from STEP where there are no pnval entries
Problem fixed by using array of nodes in case when aPnindices is empty.
2024-03-31 22:42:35 +01:00
astromko
392377a331 0033367: Modeling Algorithms - Normal projection or BOP problem [Regression]
Fixed passing of an incorrect curve into GeomAdaptor::MakeCurve() function.
2024-03-31 22:42:24 +01:00
astromko
6635f53848 0031601: Modeling Algorithms - BRepOffset_Tool Segmentation Fault
Added protection against null pointer dereferencing.
Modified BRepOffset_MakeOffset::MakeThickSolid method.
Fixed the problem with negative volume values.
Fixed several unit tests and added a new one.
2024-03-31 22:42:16 +01:00
ichesnok
f7f32bf33e 0033638: Data Exchange, Step Import - Style for tessellated object missed
TransferBRep_ShapeBinder used for tessellated face.
2024-03-31 22:41:14 +01:00
ichesnok
c1620d29fa 0033631: Data Exchange, Step import - Crash by reading STEP file
Creating Poly_Triangulation from ComplexTriangulatedSurfaceSet was fixed.
2024-03-31 22:41:08 +01:00
ichesnok
92e70f93d0 0033603: Data Exchange, Step Import - Crash reading corrupted STEP file
Crash fixed by checking IsNull().
2024-03-31 22:41:02 +01:00
ichesnok
54754bccab 0033602: Data Exchange, Step - Carriage return removing
Carriage removing integrated
2024-03-31 22:40:54 +01:00
ichesnok
33a5691ef1 0033596: Documentation - Incorrect default value read.step.tessellated
Default value of read.step.tessellated corrected.
2024-03-31 22:40:25 +01:00
abv
689b59692e 0025415: Data Exchange - Invalid result of loading a STEP file
Handling of special case found on some STEP files produced by FPX Expert 2013 (PCB design system):
edge curve is line displaced from its true position but with correct direction;
we shift the line in this case so that it passes through vertices correcty.

Protection against possible exception in writing XDE.
2024-03-31 22:40:18 +01:00
astromko
c7fd6ca63b 0033383: Modeling Algorithms - Wire/Face creation problem
ProjCurve3d and BRepAlgo_FaceRestrictor::Perform functions should not continue to work and should terminate if the BRep_Tool::Curve function returns null pointer.
2024-03-31 22:40:08 +01:00
ichesnok
9704e22131 0033261: Data Exchange, Step Import - Empty shape after reading process
Added a transfer for ShapeRepresentationRelationship in Transfer of MappedItem method,
in order to support link of components according to ISO 10303-203-2003.
2024-03-31 22:40:00 +01:00
ichesnok
f3f713569a 0033569: Data Exchange, STEP - Crash when reading multi-body file
Datum reading changed in ReadDatums() method:
using DatumSystemAP242 (DatumSystem or DatumReference) array
instead of DatumSystem array (DatumReference)
2024-03-31 22:39:52 +01:00
ichesnok
db976e0a59 0025188: Data Exchange, Step Export - Losing shapes after import
Check on null for description added to WriteStep methods
(for product, product_definition and product_definition_formation)
2024-03-31 22:39:42 +01:00
ichesnok
ee8f2ea3c2 0032980: Data Exchange - STEP import produce a crash
Check on null for loop added
2024-03-31 22:39:34 +01:00
oan
58393b24b6 0033567: Modeling Data - GeomLib_IsPlanarSurface raises exception SIGFPE Arithmetic Exception in Release mode
Add protection against zero-division
2024-03-31 22:39:22 +01:00
dpasukhi
b896c6f4af Update version to 7.8.1 dev 2024-03-31 22:39:07 +01:00
295 changed files with 2765 additions and 2772 deletions

View File

@@ -475,7 +475,7 @@ Modify this parameter with:
if(!Interface_Static::SetIVal("read.step.tessellated",1))
.. error ..
~~~~
Default value is 0 (On).
Default value is 1 (On).
@subsubsection occt_step_2_3_4 Performing the STEP file translation

View File

@@ -808,8 +808,11 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
const Standard_Integer aNbp = lastP - firstP + 1;
// The first parameter should always be zero according to all the logic below,
// so division by any value will give zero anyway, so it should never be scaled
// to avoid case when there is only one parameter in the array thus division by zero happens.
TheParameters(firstP) = 0.0;
if (aNbp == 2) {
TheParameters(firstP) = 0.0;
TheParameters(lastP) = 1.0;
}
else if (Par == Approx_ChordLength || Par == Approx_Centripetal)
@@ -820,7 +823,6 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
if (nbP3d == 0) mynbP3d = 1;
if (nbP2d == 0) mynbP2d = 1;
TheParameters(firstP) = 0.0;
dist = 0.0;
TColgp_Array1OfPnt tabP(1, mynbP3d);
TColgp_Array1OfPnt tabPP(1, mynbP3d);
@@ -861,10 +863,10 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
}
}
for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
for (i = firstP + 1; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
}
else {
for (i = firstP; i <= lastP; i++) {
for (i = firstP + 1; i <= lastP; i++) {
TheParameters(i) = (Standard_Real(i) - firstP) /
(Standard_Real(lastP - Standard_Real(firstP)));
}

View File

@@ -103,7 +103,7 @@ static Standard_Boolean ChangePCurve (TopoDS_Edge& E,
//purpose :
//=======================================================================
static void ProjCurve3d (TopoDS_Edge& E,
static bool ProjCurve3d (TopoDS_Edge& E,
const Handle(Geom_Surface)& S,
TopLoc_Location& L)
{
@@ -111,6 +111,10 @@ static void ProjCurve3d (TopoDS_Edge& E,
TopLoc_Location LE;
Standard_Real f,l;
Handle(Geom_Curve) C = BRep_Tool::Curve(E,LE,f,l);
if (C.IsNull())
{
return false;
}
Handle(Geom_TrimmedCurve) CT = new Geom_TrimmedCurve(C,f,l);
TopLoc_Location LL = L.Inverted().Multiplied(LE);
@@ -118,6 +122,7 @@ static void ProjCurve3d (TopoDS_Edge& E,
Handle(Geom2d_Curve) C2 = GeomProjLib::Curve2d (CT,S);
BB.UpdateEdge(E,C2,S,L,Precision::Confusion());
return true;
}
//=======================================================================
@@ -165,13 +170,19 @@ void BRepAlgo_FaceRestrictor::Perform()
// no pcurve on the reference surface.
if (modeProj) {
// Projection of the 3D curve on surface.
ProjCurve3d ( E, S, L);
if (!ProjCurve3d(E, S, L))
{
return;
}
}
else {
// return the first pcurve glued on <S>
Standard_Boolean YaPCurve = ChangePCurve (E, S, L);
if (!YaPCurve) {
ProjCurve3d (E, S, L);
if (!ProjCurve3d(E, S, L))
{
return;
}
}
}
}

View File

@@ -333,7 +333,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
Only2d = Standard_True;
if(Only2d && Only3d) {
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(*hcur),
Udeb, Ufin);
prj = MKed.Edge();
BB.UpdateEdge(TopoDS::Edge(prj),
@@ -369,7 +369,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if(!Only3d) PCur2d = appr.Curve2d();
if(Only2d) {
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(*hcur),
Udeb, Ufin);
prj = MKed.Edge();
}

View File

@@ -99,38 +99,44 @@ Standard_Boolean BRepMesh_BaseMeshAlgo::initDataStructure()
for (Standard_Integer aEdgeIt = 0; aEdgeIt < aDWire->EdgesNb(); ++aEdgeIt)
{
const IMeshData::IEdgeHandle aDEdge = aDWire->GetEdge(aEdgeIt);
const IMeshData::IEdgeHandle aDEdge = aDWire->GetEdge (aEdgeIt);
const IMeshData::ICurveHandle& aCurve = aDEdge->GetCurve();
const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(
myDFace.get(), aDWire->GetEdgeOrientation(aEdgeIt));
const IMeshData::ListOfInteger& aListOfPCurves = aDEdge->GetPCurves (myDFace.get());
const TopAbs_Orientation aOri = fixSeamEdgeOrientation(aDEdge, aPCurve);
Standard_Integer aPrevNodeIndex = -1;
const Standard_Integer aLastPoint = aPCurve->ParametersNb() - 1;
for (Standard_Integer aPointIt = 0; aPointIt <= aLastPoint; ++aPointIt)
for (IMeshData::ListOfInteger::Iterator aPCurveIt(aListOfPCurves); aPCurveIt.More(); aPCurveIt.Next())
{
const Standard_Integer aNodeIndex = registerNode(
aCurve ->GetPoint(aPointIt),
aPCurve->GetPoint(aPointIt),
BRepMesh_Frontier, Standard_False/*aPointIt > 0 && aPointIt < aLastPoint*/);
const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve (aPCurveIt.Value());
aPCurve->GetIndex(aPointIt) = aNodeIndex;
myUsedNodes->Bind(aNodeIndex, aNodeIndex);
const TopAbs_Orientation aOri = fixSeamEdgeOrientation(aDEdge, aPCurve);
if (aPrevNodeIndex != -1 && aPrevNodeIndex != aNodeIndex)
Standard_Integer aPrevNodeIndex = -1;
const Standard_Integer aLastPoint = aPCurve->ParametersNb() - 1;
Standard_Integer aPointIt = 0;
for (; aPointIt <= aLastPoint; ++aPointIt)
{
const Standard_Integer aLinksNb = myStructure->NbLinks();
const Standard_Integer aLinkIndex = addLinkToMesh(aPrevNodeIndex, aNodeIndex, aOri);
if (aWireIt != 0 && aLinkIndex <= aLinksNb)
{
// Prevent holes around wire of zero area.
BRepMesh_Edge& aLink = const_cast<BRepMesh_Edge&>(myStructure->GetLink(aLinkIndex));
aLink.SetMovability(BRepMesh_Fixed);
}
}
const Standard_Integer aNodeIndex = registerNode(
aCurve->GetPoint(aPointIt),
aPCurve->GetPoint(aPointIt),
BRepMesh_Frontier, Standard_False/*aPointIt > 0 && aPointIt < aLastPoint*/);
aPrevNodeIndex = aNodeIndex;
aPCurve->GetIndex (aPointIt) = aNodeIndex;
myUsedNodes->Bind (aNodeIndex, aNodeIndex);
if (aPrevNodeIndex != -1 && aPrevNodeIndex != aNodeIndex)
{
const Standard_Integer aLinksNb = myStructure->NbLinks();
const Standard_Integer aLinkIndex = addLinkToMesh(aPrevNodeIndex, aNodeIndex, aOri);
if (aWireIt != 0 && aLinkIndex <= aLinksNb)
{
// Prevent holes around wire of zero area.
BRepMesh_Edge& aLink = const_cast<BRepMesh_Edge&>(myStructure->GetLink(aLinkIndex));
aLink.SetMovability(BRepMesh_Fixed);
}
}
aPrevNodeIndex = aNodeIndex;
}
}
}
}

View File

@@ -91,6 +91,15 @@ const IMeshData::IPCurveHandle& BRepMeshData_Edge::GetPCurve (
myPCurves (aListOfPCurves.Last ());
}
//=======================================================================
// Function: GetPCurves
// Purpose :
//=======================================================================
const IMeshData::ListOfInteger& BRepMeshData_Edge::GetPCurves (const IMeshData::IFacePtr& theDFace) const
{
return myPCurvesMap.Find (theDFace);
}
//=======================================================================
// Function: GetPCurve
// Purpose :

View File

@@ -48,6 +48,10 @@ public:
const IMeshData::IFacePtr& theDFace,
const TopAbs_Orientation theOrientation) const Standard_OVERRIDE;
//! Returns an array of pcurves indices for the specified discrete face.
Standard_EXPORT virtual const IMeshData::ListOfInteger& GetPCurves(
const IMeshData::IFacePtr& theDFace) const Standard_OVERRIDE;
//! Returns pcurve with the given index.
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
const Standard_Integer theIndex) const Standard_OVERRIDE;

View File

@@ -1292,11 +1292,10 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
for ( ;exp2.More(); exp2.Next()) {
LOE.Append(exp2.Current());
}
BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide,myTol);
//-------------------------------------------------------
// If no trace try intersection.
//-------------------------------------------------------
if (LInt1.IsEmpty()) {
if (!BRepOffset_Tool::TryProject(CF, OF1, LOE, LInt1, LInt2, mySide, myTol) || LInt1.IsEmpty()) {
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
}
Store (CF,OF1,LInt1,LInt2);

View File

@@ -1175,12 +1175,16 @@ void BRepOffset_MakeOffset::MakeThickSolid(const Message_ProgressRange& theRange
{
NbOF++;
}
if (NbOF <= NbF)
if (NbOF < NbF)
{
myDone = Standard_False;
myError = BRepOffset_UnknownError;
return;
}
if (NbOF == NbF)
{
myOffset = 0;
}
}
if (myOffset > 0 ) myOffsetShape.Reverse();

View File

@@ -1881,6 +1881,10 @@ Standard_Boolean BRepOffset_Tool::TryProject
if (C.IsNull()) {
BRepLib::BuildCurve3d(CurE,BRep_Tool::Tolerance(CurE));
C = BRep_Tool::Curve(CurE,L,f,l);
if (C.IsNull())
{
return Standard_False;
}
}
C = new Geom_TrimmedCurve(C,f,l);
if ( !L.IsIdentity()) C->Transform(L);
@@ -3179,12 +3183,23 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
else
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - 10*FaceDU;
UU2 = UF2 + 10*FaceDU;
VV1 = VF1 - 10*FaceDV;
VV2 = VF2 + 10*FaceDV;
if (theExtensionMode == 2)
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - 10*FaceDU;
UU2 = UF2 + 10*FaceDU;
VV1 = VF1 - 10*FaceDV;
VV2 = VF2 + 10*FaceDV;
}
else
{
Standard_Real aSize = theLenBeforeUfirst;
UU1 = UF1 - aSize;
UU2 = UF2 + aSize;
VV1 = VF1 - aSize;
VV2 = VF2 + aSize;
}
coeff = 1.;
}
@@ -3519,9 +3534,8 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
if (ToBuild.IsBound(E)) {
TopTools_ListOfShape LOE;
LOE.Append(E);
BRepOffset_Tool::TryProject (TopoDS::Face(ToBuild(E)),
EF,LOE,LInt2,LInt1,Side,TolConf);
if (!LInt1.IsEmpty())
if (BRepOffset_Tool::TryProject(TopoDS::Face(ToBuild(E)), EF, LOE, LInt2, LInt1, Side, TolConf)
&& !LInt1.IsEmpty())
ToBuild.UnBind(E);
}
}

View File

@@ -515,8 +515,13 @@ BSplCLib::EvalBsplineBasis
//
// this should be always invertible if ii is correctly computed
//
Factor = (Parameter - FlatKnots(ii - qq + pp + 1))
/ (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)) ;
const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1));
if (Abs (aScale) < gp::Resolution())
{
return 2;
}
Factor = (Parameter - FlatKnots(ii - qq + pp + 1)) / aScale;
Saved = Factor * BsplineBasis(1,pp) ;
BsplineBasis(1,pp) *= (1.0e0 - Factor) ;
BsplineBasis(1,pp) += BsplineBasis(1,qq) ;
@@ -536,7 +541,13 @@ BSplCLib::EvalBsplineBasis
}
for (pp = 1 ; pp <= qq - 1 ; pp++) {
Inverse = 1.0e0 / (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)) ;
const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1));
if (Abs (aScale) < gp::Resolution())
{
return 2;
}
Inverse = 1.0e0 / aScale;
Factor = (Parameter - FlatKnots(ii - qq + pp + 1)) * Inverse ;
Saved = Factor * BsplineBasis(1,pp) ;
BsplineBasis(1,pp) *= (1.0e0 - Factor) ;

View File

@@ -20,10 +20,10 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <StepData_Factors.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Axis1Placement;
class gp_Ax1;
class gp_Ax2d;
@@ -43,16 +43,16 @@ public:
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax1& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax2d& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom_Axis1Placement)& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom2d_AxisPlacement)& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Axis1Placement)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Axis2Placement2d;
class gp_Ax2;
class gp_Ax22d;
@@ -40,10 +41,10 @@ public:
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax2& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax22d& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Axis2Placement2d)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
#include <StepData_StepModel.hxx>
class StepData_Factors;
class StepGeom_Axis2Placement3d;
class gp_Ax2;
class gp_Ax3;
@@ -41,19 +42,19 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const StepData_Factors& theLocalFactors = StepData_Factors());
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax2& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax3& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Trsf& T,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const Handle(Geom_Axis2Placement)& A,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Axis2Placement3d)& Value() const;

View File

@@ -24,6 +24,7 @@
#include <GeomToStep_Root.hxx>
class Geom_BSplineCurve;
class Geom2d_BSplineCurve;
class StepData_Factors;
class StepGeom_BSplineCurveWithKnots;
@@ -40,10 +41,10 @@ public:
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom2d_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnots)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
class Geom_BSplineCurve;
class Geom2d_BSplineCurve;
@@ -41,10 +42,10 @@ public:
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom2d_BSplineCurve)& Bsplin,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)& Value() const;

View File

@@ -22,6 +22,7 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BSplineSurfaceWithKnots;
class Geom_BSplineSurface;
@@ -39,7 +40,7 @@ public:
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnots(const Handle(Geom_BSplineSurface)& Bsplin,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnots)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
class Geom_BSplineSurface;
@@ -40,7 +41,7 @@ public:
Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface(const Handle(Geom_BSplineSurface)& Bsplin,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BoundedCurve;
class Geom_BoundedCurve;
class Geom2d_BoundedCurve;
@@ -41,10 +42,10 @@ public:
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom_BoundedCurve)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom2d_BoundedCurve)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_BoundedCurve)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_BoundedSurface;
class Geom_BoundedSurface;
@@ -40,7 +41,7 @@ public:
Standard_EXPORT GeomToStep_MakeBoundedSurface(const Handle(Geom_BoundedSurface)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_BoundedSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Circle;
class gp_Circ;
class Geom_Circle;
@@ -41,13 +42,13 @@ public:
Standard_EXPORT GeomToStep_MakeCircle(const gp_Circ& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom_Circle)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom2d_Circle)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Circle)& Value() const;

View File

@@ -25,6 +25,7 @@
class StepGeom_Conic;
class Geom_Conic;
class Geom2d_Conic;
class StepData_Factors;
//! This class implements the mapping between classes
@@ -39,10 +40,10 @@ public:
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom_Conic)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom2d_Conic)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Conic)& Value() const;

View File

@@ -24,6 +24,7 @@
#include <GeomToStep_Root.hxx>
class StepGeom_ConicalSurface;
class Geom_ConicalSurface;
class StepData_Factors;
//! This class implements the mapping between class
@@ -38,7 +39,7 @@ public:
Standard_EXPORT GeomToStep_MakeConicalSurface(const Handle(Geom_ConicalSurface)& CSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_ConicalSurface)& Value() const;

View File

@@ -22,6 +22,7 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Curve;
class Geom_Curve;
class Geom2d_Curve;
@@ -39,10 +40,10 @@ public:
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom_Curve)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom2d_Curve)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Curve)& Value() const;

View File

@@ -24,6 +24,7 @@
#include <GeomToStep_Root.hxx>
class StepGeom_CylindricalSurface;
class Geom_CylindricalSurface;
class StepData_Factors;
//! This class implements the mapping between class
@@ -38,7 +39,7 @@ public:
Standard_EXPORT GeomToStep_MakeCylindricalSurface(const Handle(Geom_CylindricalSurface)& CSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_CylindricalSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_ElementarySurface;
class Geom_ElementarySurface;
@@ -40,7 +41,7 @@ public:
Standard_EXPORT GeomToStep_MakeElementarySurface(const Handle(Geom_ElementarySurface)& S,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_ElementarySurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Ellipse;
class gp_Elips;
class Geom_Ellipse;
@@ -41,13 +42,13 @@ public:
Standard_EXPORT GeomToStep_MakeEllipse(const gp_Elips& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom_Ellipse)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom2d_Ellipse)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Ellipse)& Value() const;

View File

@@ -38,10 +38,10 @@ public:
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Hyperbola)& Value() const;

View File

@@ -22,6 +22,7 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Line;
class gp_Lin;
class gp_Lin2d;
@@ -41,16 +42,16 @@ public:
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin& L,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const gp_Lin2d& L,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom_Line)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom2d_Line)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Line)& Value() const;

View File

@@ -25,6 +25,7 @@
class StepGeom_Parabola;
class Geom2d_Parabola;
class Geom_Parabola;
class StepData_Factors;
//! This class implements the mapping between the class
@@ -38,10 +39,10 @@ public:
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Parabola)& Value() const;

View File

@@ -22,6 +22,7 @@
#include <Standard_Handle.hxx>
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Plane;
class gp_Pln;
class Geom_Plane;
@@ -39,10 +40,10 @@ public:
Standard_EXPORT GeomToStep_MakePlane(const gp_Pln& P,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakePlane(const Handle(Geom_Plane)& P,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Plane)& Value() const;

View File

@@ -25,6 +25,7 @@
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
class StepData_Factors;
class StepGeom_Polyline;
@@ -38,10 +39,10 @@ public:
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt& P,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt2d& P,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Polyline)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_RectangularTrimmedSurface;
class Geom_RectangularTrimmedSurface;
@@ -40,7 +41,7 @@ public:
Standard_EXPORT GeomToStep_MakeRectangularTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& RTSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_RectangularTrimmedSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SphericalSurface;
class Geom_SphericalSurface;
@@ -39,7 +40,7 @@ public:
Standard_EXPORT GeomToStep_MakeSphericalSurface(const Handle(Geom_SphericalSurface)& CSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_SphericalSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Surface;
class Geom_Surface;
@@ -39,7 +40,7 @@ public:
Standard_EXPORT GeomToStep_MakeSurface(const Handle(Geom_Surface)& C,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Surface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SurfaceOfLinearExtrusion;
class Geom_SurfaceOfLinearExtrusion;
@@ -39,7 +40,7 @@ public:
Standard_EXPORT GeomToStep_MakeSurfaceOfLinearExtrusion(const Handle(Geom_SurfaceOfLinearExtrusion)& CSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_SurfaceOfLinearExtrusion)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SurfaceOfRevolution;
class Geom_SurfaceOfRevolution;
@@ -39,7 +40,7 @@ public:
Standard_EXPORT GeomToStep_MakeSurfaceOfRevolution(const Handle(Geom_SurfaceOfRevolution)& RevSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_SurfaceOfRevolution)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_SweptSurface;
class Geom_SweptSurface;
@@ -40,7 +41,7 @@ public:
Standard_EXPORT GeomToStep_MakeSweptSurface(const Handle(Geom_SweptSurface)& S,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_SweptSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_ToroidalSurface;
class Geom_ToroidalSurface;
@@ -39,7 +40,7 @@ public:
Standard_EXPORT GeomToStep_MakeToroidalSurface(const Handle(Geom_ToroidalSurface)& TorSurf,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_ToroidalSurface)& Value() const;

View File

@@ -23,6 +23,7 @@
#include <GeomToStep_Root.hxx>
class StepData_Factors;
class StepGeom_Vector;
class gp_Vec;
class gp_Vec2d;
@@ -42,16 +43,16 @@ public:
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec& V,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const gp_Vec2d& V,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom_Vector)& V,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom2d_Vector)& V,
const StepData_Factors& theLocalFactors = StepData_Factors());
const StepData_Factors& theLocalFactors);
Standard_EXPORT const Handle(StepGeom_Vector)& Value() const;

View File

@@ -20,7 +20,6 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <StepData_Factors.hxx>
#include <Standard_Boolean.hxx>

View File

@@ -150,8 +150,7 @@ void Graphic3d_CLight::SetEnabled (Standard_Boolean theIsOn)
void Graphic3d_CLight::SetCastShadows (Standard_Boolean theToCast)
{
if (myType != Graphic3d_TypeOfLightSource_Directional
&& myType != Graphic3d_TypeOfLightSource_Spot
&& myType != Graphic3d_TypeOfLightSource_Positional)
&& myType != Graphic3d_TypeOfLightSource_Spot)
{
throw Standard_NotImplemented ("Graphic3d_CLight::SetCastShadows() is not implemented for this light type");
}

View File

@@ -200,24 +200,6 @@ void Graphic3d_Camera::Copy (const Handle(Graphic3d_Camera)& theOther)
CopyOrientationData (theOther);
}
// =======================================================================
// function : GetDefaultZNear
// purpose :
// =======================================================================
Standard_Real Graphic3d_Camera::GetDefaultZNear()
{
return DEFAULT_ZNEAR;
}
// =======================================================================
// function : GetDefaultZFar
// purpose :
// =======================================================================
Standard_Real Graphic3d_Camera::GetDefaultZFar()
{
return DEFAULT_ZFAR;
}
// =======================================================================
// function : SetIdentityOrientation
// purpose :

View File

@@ -202,12 +202,6 @@ public:
//! @name Public camera properties
public:
//! return default valut for znear.
Standard_EXPORT static Standard_Real GetDefaultZNear();
//! return default valut for zfar.
Standard_EXPORT static Standard_Real GetDefaultZFar();
//! Get camera look direction.
//! @return camera look direction.
const gp_Dir& Direction() const { return myDirection; }

View File

@@ -52,29 +52,3 @@ Graphic3d_CubeMap::~Graphic3d_CubeMap()
{
//
}
// =======================================================================
// function : GetCubeDirection
// purpose :
// =======================================================================
gp_Dir Graphic3d_CubeMap::GetCubeDirection (Graphic3d_CubeMapSide theFace)
{
const Standard_Integer aDiv2 = theFace / 2;
const Standard_Integer aMod2 = theFace % 2;
return gp_Dir (aDiv2 == 0 ? aMod2 == 0 ? 1.0 : -1.0 : 0.0,
aDiv2 == 1 ? aMod2 == 0 ? 1.0 : -1.0 : 0.0,
aDiv2 == 2 ? aMod2 == 0 ? 1.0 : -1.0 : 0.0);
}
// =======================================================================
// function : GetCubeUp
// purpose :
// =======================================================================
gp_Dir Graphic3d_CubeMap::GetCubeUp (Graphic3d_CubeMapSide theFace)
{
const Standard_Integer aDiv2 = theFace / 2;
const Standard_Integer aMod2 = theFace % 2;
return gp_Dir (0.0,
aDiv2 == 0 ? 1.0 : aDiv2 == 2 ? -1.0 : 0.0,
aDiv2 == 1 ? aMod2 == 0 ? 1.0 : -1.0 : 0.0);
}

View File

@@ -15,7 +15,6 @@
#ifndef _Graphic3d_CubeMap_HeaderFile
#define _Graphic3d_CubeMap_HeaderFile
#include <gp_Dir.hxx>
#include <Graphic3d_CubeMapOrder.hxx>
#include <Graphic3d_TextureMap.hxx>
@@ -91,12 +90,6 @@ public:
//! Empty destructor.
Standard_EXPORT virtual ~Graphic3d_CubeMap();
//! Returns direction vector for cubemap's @theFace
Standard_EXPORT gp_Dir static GetCubeDirection (Graphic3d_CubeMapSide theFace);
//! Returns up vector for cubemap's @theFace
Standard_EXPORT gp_Dir static GetCubeUp (Graphic3d_CubeMapSide theFace);
protected:
Graphic3d_CubeMapSide myCurrentSide; //!< Iterator state

View File

@@ -86,31 +86,6 @@ Standard_Boolean Graphic3d_LightSet::Remove (const Handle(Graphic3d_CLight)& the
return Standard_True;
}
// =======================================================================
// function : CalculateNbShadows
// purpose :
// =======================================================================
void Graphic3d_LightSet::CalculateNbShadows (Standard_Integer& theNb2DShadows, Standard_Integer& theNbPointShadows)
{
theNb2DShadows = 0;
theNbPointShadows = 0;
for (NCollection_IndexedDataMap<Handle(Graphic3d_CLight), Standard_Size>::Iterator aLightIter(myLights); aLightIter.More(); aLightIter.Next())
{
const Handle(Graphic3d_CLight)& aLight = aLightIter.Key();
if (aLight->ToCastShadows())
{
if (aLight->Type() == Graphic3d_TypeOfLightSource_Positional)
{
++theNbPointShadows;
}
else
{
++theNb2DShadows;
}
}
}
}
// =======================================================================
// function : UpdateRevision
// purpose :

View File

@@ -143,9 +143,6 @@ public:
//! Returns total amount of lights of specified type.
Standard_Integer NbLightsOfType (Graphic3d_TypeOfLightSource theType) const { return myLightTypes[theType]; }
//! Calculates total amount of enabled lights castings shadows (point lights and others).
Standard_EXPORT void CalculateNbShadows (Standard_Integer& theNb2DShadows, Standard_Integer& theNbPointShadows);
//! @name cached state of lights set updated by UpdateRevision()
public:

View File

@@ -19,7 +19,6 @@
#include <Message.hxx>
#include "../Shaders/Shaders_LightShadow_glsl.pxx"
#include "../Shaders/Shaders_LightPointShadow_glsl.pxx"
#include "../Shaders/Shaders_PBRDistribution_glsl.pxx"
#include "../Shaders/Shaders_PBRDirectionalLight_glsl.pxx"
#include "../Shaders/Shaders_PBRGeometry_glsl.pxx"
@@ -517,7 +516,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramFont() con
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (0);
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
@@ -647,7 +645,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramFboBlit (S
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (0);
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
@@ -703,7 +700,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramOitComposi
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (0);
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
@@ -1141,7 +1137,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramUnlit (Sta
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (aNbClipPlanes);
aProgramSrc->SetAlphaTest ((theBits & Graphic3d_ShaderFlags_AlphaTest) != 0);
const Standard_Integer aNbGeomInputVerts = !aSrcGeom.IsEmpty() ? 3 : 0;
@@ -1157,11 +1152,10 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramUnlit (Sta
// =======================================================================
TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_Integer& theNbLights,
const Handle(Graphic3d_LightSet)& theLights,
Standard_Boolean theHasVertColor,
Standard_Boolean theIsPBR,
Standard_Boolean theHasTexColor,
Standard_Integer theNbShadowMaps,
Standard_Integer theNbShadowCubeMaps) const
Standard_Boolean theHasVertColor,
Standard_Boolean theIsPBR,
Standard_Boolean theHasTexColor,
Standard_Integer theNbShadowMaps) const
{
TCollection_AsciiString aLightsFunc, aLightsLoop;
theNbLights = 0;
@@ -1171,8 +1165,6 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
if (theNbLights <= THE_NB_UNROLLED_LIGHTS_MAX)
{
Standard_Integer anIndex = 0;
Standard_Integer a2DSamplerIndex = 0;
Standard_Integer aCubeSamplerIndex = 0;
for (Graphic3d_LightSet::Iterator aLightIter (theLights, Graphic3d_LightSet::IterationFilter_ExcludeDisabledAndAmbient);
aLightIter.More(); aLightIter.Next())
{
@@ -1189,7 +1181,7 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
{
aLightsLoop = aLightsLoop +
EOL" occDirectionalLight (" + anIndex + ", theNormal, theView, theIsFront,"
EOL" occLightShadow (occShadowMapSamplers[" + a2DSamplerIndex++ + "], " + anIndex + ", theNormal));";
EOL" occLightShadow (occShadowMapSamplers[" + anIndex + "], " + anIndex + ", theNormal));";
}
else
{
@@ -1200,18 +1192,7 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
}
case Graphic3d_TypeOfLightSource_Positional:
{
if (theNbShadowCubeMaps > 0
&& aLightIter.Value()->ToCastShadows())
{
aLightsLoop = aLightsLoop +
EOL" occPointLight (" + anIndex + ", theNormal, theView, aPoint, theIsFront,"
EOL" occLightPointShadow (occShadowCubeMapSamplers[" + aCubeSamplerIndex++ + "],"
EOL" " + anIndex + ", aPoint, theNormal)); ";
}
else
{
aLightsLoop = aLightsLoop + EOL" occPointLight (" + anIndex + ", theNormal, theView, aPoint, theIsFront, 1.0);";
}
aLightsLoop = aLightsLoop + EOL" occPointLight (" + anIndex + ", theNormal, theView, aPoint, theIsFront);";
++anIndex;
break;
}
@@ -1222,7 +1203,7 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
{
aLightsLoop = aLightsLoop +
EOL" occSpotLight (" + anIndex + ", theNormal, theView, aPoint, theIsFront,"
EOL" occLightShadow (occShadowMapSamplers[" + a2DSamplerIndex++ + "], " + anIndex + ", theNormal));";
EOL" occLightShadow (occShadowMapSamplers[" + anIndex + "], " + anIndex + ", theNormal));";
}
else
{
@@ -1261,7 +1242,7 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
aLightsLoop +=
EOL" if (aType == OccLightType_Point)"
EOL" {"
EOL" occPointLight (anIndex, theNormal, theView, aPoint, theIsFront, 1.0);"
EOL" occPointLight (anIndex, theNormal, theView, aPoint, theIsFront);"
EOL" }";
}
if (theLights->NbEnabledLightsOfType (Graphic3d_TypeOfLightSource_Spot) > 0)
@@ -1290,7 +1271,6 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
}
bool isShadowShaderAdded = false;
bool isShadowCubeShaderAdded = false;
if (theLights->NbEnabledLightsOfType (Graphic3d_TypeOfLightSource_Directional) == 1
&& theNbLights == 1
&& !theIsPBR
@@ -1311,11 +1291,6 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
}
if (theLights->NbEnabledLightsOfType (Graphic3d_TypeOfLightSource_Positional) > 0)
{
if (theNbShadowCubeMaps > 0 && !isShadowCubeShaderAdded)
{
aLightsFunc += Shaders_LightPointShadow_glsl;
isShadowCubeShaderAdded = true;
}
aLightsFunc += theIsPBR ? Shaders_PBRPointLight_glsl : Shaders_PhongPointLight_glsl;
}
if (theLights->NbEnabledLightsOfType (Graphic3d_TypeOfLightSource_Spot) > 0)
@@ -1500,7 +1475,7 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud (c
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 BackColor", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
Standard_Integer aNbLights = 0;
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcVertColor.IsEmpty(), false, toUseTexColor, 0, 0);
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcVertColor.IsEmpty(), false, toUseTexColor, 0);
aSrcVert = TCollection_AsciiString()
+ THE_FUNC_transformNormal_world
+ EOL
@@ -1545,7 +1520,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud (c
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (aNbLights);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (aNbClipPlanes);
aProgramSrc->SetAlphaTest ((theBits & Graphic3d_ShaderFlags_AlphaTest) != 0);
const Standard_Integer aNbGeomInputVerts = !aSrcGeom.IsEmpty() ? 3 : 0;
@@ -1563,8 +1537,7 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
const Standard_Integer theBits,
const Standard_Boolean theIsFlatNormal,
const Standard_Boolean theIsPBR,
const Standard_Integer theNbShadowMaps,
const Standard_Integer theNbShadowCubeMaps) const
const Standard_Integer theNbShadowMaps) const
{
TCollection_AsciiString aPhongCompLight = TCollection_AsciiString() +
"computeLighting (normalize (Normal), normalize (View), PositionWorld, gl_FrontFacing)";
@@ -1717,19 +1690,12 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 PositionWorld", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec3 View", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
if (theNbShadowMaps + theNbShadowCubeMaps > 0)
if (theNbShadowMaps > 0)
{
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("mat4 occShadowMapMatrices[THE_NB_SHADOWMAPS]", Graphic3d_TOS_VERTEX));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("vec2 occShadowMapRangeParams[THE_NB_SHADOWMAPS]", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("vec2 occShadowMapSizeBias", Graphic3d_TOS_FRAGMENT));
if (theNbShadowMaps > 0)
{
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("sampler2D occShadowMapSamplers[THE_NB_SHADOWMAPS2D]", Graphic3d_TOS_FRAGMENT));
}
if (theNbShadowCubeMaps > 0)
{
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("samplerCube occShadowCubeMapSamplers[THE_NB_SHADOWMAPSCUBE]", Graphic3d_TOS_FRAGMENT));
}
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("mat4 occShadowMapMatrices[THE_NB_SHADOWMAPS]", Graphic3d_TOS_VERTEX));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("sampler2D occShadowMapSamplers[THE_NB_SHADOWMAPS]", Graphic3d_TOS_FRAGMENT));
aUniforms.Append (Graphic3d_ShaderObject::ShaderVariable ("vec2 occShadowMapSizeBias", Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 PosLightSpace[THE_NB_SHADOWMAPS]", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aSrcVertExtraMain +=
EOL" for (int aShadowIter = 0; aShadowIter < THE_NB_SHADOWMAPS; ++aShadowIter)"
@@ -1763,7 +1729,7 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
Standard_Integer aNbLights = 0;
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcFragGetVertColor.IsEmpty(),
theIsPBR, toUseTexColor, theNbShadowMaps, theNbShadowCubeMaps);
theIsPBR, toUseTexColor, theNbShadowMaps);
aSrcFrag += TCollection_AsciiString()
+ EOL
+ aSrcFragGetVertColor
@@ -1779,12 +1745,11 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
+ EOL"}";
const TCollection_AsciiString aProgId = TCollection_AsciiString (theIsFlatNormal ? "flat-" : "phong-") + (theIsPBR ? "pbr-" : "")
+ genLightKey (theLights, (theNbShadowMaps + theNbShadowCubeMaps) > 0) + "-";
+ genLightKey (theLights, theNbShadowMaps > 0) + "-";
defaultGlslVersion (aProgramSrc, aProgId, theBits, isFlatNormal);
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (aNbLights);
aProgramSrc->SetNbShadowMaps (theNbShadowMaps);
aProgramSrc->SetNbShadowCubeMaps (theNbShadowCubeMaps);
aProgramSrc->SetNbClipPlanesMax (aNbClipPlanes);
aProgramSrc->SetAlphaTest ((theBits & Graphic3d_ShaderFlags_AlphaTest) != 0);
@@ -1979,7 +1944,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramStereo (Gr
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (0);
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
@@ -2016,7 +1980,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramBoundBox()
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (0);
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
@@ -2078,7 +2041,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getPBREnvBakingProgram
aProgramSrc->SetDefaultSampler (false);
aProgramSrc->SetNbLightsMax (0);
aProgramSrc->SetNbShadowMaps (0);
aProgramSrc->SetNbShadowCubeMaps (0);
aProgramSrc->SetNbClipPlanesMax (0);
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgramSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));
@@ -2145,7 +2107,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getBgCubeMapProgram() c
aProgSrc->SetDefaultSampler (false);
aProgSrc->SetNbLightsMax (0);
aProgSrc->SetNbShadowMaps (0);
aProgSrc->SetNbShadowCubeMaps (0);
aProgSrc->SetNbClipPlanesMax (0);
aProgSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcVert, Graphic3d_TOS_VERTEX, aUniforms, aStageInOuts));
aProgSrc->AttachShader (Graphic3d_ShaderObject::CreateFromSource (aSrcFrag, Graphic3d_TOS_FRAGMENT, aUniforms, aStageInOuts));

View File

@@ -134,8 +134,7 @@ protected:
const Standard_Integer theBits,
const Standard_Boolean theIsFlatNormal,
const Standard_Boolean theIsPBR,
const Standard_Integer theNbShadowMaps,
const Standard_Integer theNbShadowCubeMaps) const;
const Standard_Integer theNbShadowMaps) const;
//! Prepare standard GLSL program for bounding box.
Standard_EXPORT Handle(Graphic3d_ShaderProgram) getStdProgramBoundBox() const;
@@ -208,11 +207,10 @@ protected:
//! @param theNbShadowMaps [in] flag to include shadow map
Standard_EXPORT TCollection_AsciiString stdComputeLighting (Standard_Integer& theNbLights,
const Handle(Graphic3d_LightSet)& theLights,
Standard_Boolean theHasVertColor,
Standard_Boolean theIsPBR,
Standard_Boolean theHasTexColor,
Standard_Integer theNbShadowMaps,
Standard_Integer theNbShadowCubeMaps) const;
Standard_Boolean theHasVertColor,
Standard_Boolean theIsPBR,
Standard_Boolean theHasTexColor,
Standard_Integer theNbShadowMaps) const;
protected:

View File

@@ -80,7 +80,6 @@ const TCollection_AsciiString& Graphic3d_ShaderProgram::ShadersFolder()
Graphic3d_ShaderProgram::Graphic3d_ShaderProgram()
: myNbLightsMax (THE_MAX_LIGHTS_DEFAULT),
myNbShadowMaps (0),
myNbShadowCubeMaps (0),
myNbClipPlanesMax (THE_MAX_CLIP_PLANES_DEFAULT),
myNbFragOutputs (THE_NB_FRAG_OUTPUTS),
myTextureSetBits (Graphic3d_TextureSetBits_NONE),

View File

@@ -96,18 +96,12 @@ public:
//! Specify the length of array of light sources (THE_MAX_LIGHTS).
void SetNbLightsMax (Standard_Integer theNbLights) { myNbLightsMax = theNbLights; }
//! Return the length of array of 2D shadow maps (THE_NB_SHADOWMAP2D); 0 by default.
//! Return the length of array of shadow maps (THE_NB_SHADOWMAPS); 0 by default.
Standard_Integer NbShadowMaps() const { return myNbShadowMaps; }
//! Specify the length of array of 2D shadow maps (THE_NB_SHADOWMAP2D).
//! Specify the length of array of shadow maps (THE_NB_SHADOWMAPS).
void SetNbShadowMaps (Standard_Integer theNbMaps) { myNbShadowMaps = theNbMaps; }
//! Return the length of array of shadow cube maps (THE_NB_SHADOWMAPCUBE); 0 by default.
Standard_Integer NbShadowCubeMaps() const { return myNbShadowCubeMaps; }
//! Specify the length of array of shadow cube maps (THE_NB_SHADOWMAPCUBE).
void SetNbShadowCubeMaps (Standard_Integer theNbMaps) { myNbShadowCubeMaps = theNbMaps; }
//! Return the length of array of clipping planes (THE_MAX_CLIP_PLANES),
//! to be used for initialization occClipPlaneEquations.
//! Default value is THE_MAX_CLIP_PLANES_DEFAULT.
@@ -220,21 +214,20 @@ public:
private:
TCollection_AsciiString myID; //!< the unique identifier of program object
Graphic3d_ShaderObjectList myShaderObjects; //!< the list of attached shader objects
Graphic3d_ShaderVariableList myVariables; //!< the list of custom uniform variables
Graphic3d_ShaderAttributeList myAttributes; //!< the list of custom vertex attributes
TCollection_AsciiString myHeader; //!< GLSL header with version code and used extensions
Standard_Integer myNbLightsMax; //!< length of array of light sources (THE_MAX_LIGHTS)
Standard_Integer myNbShadowMaps; //!< length of array of shadow maps (THE_NB_SHADOWMAP2D)
Standard_Integer myNbShadowCubeMaps; //!< length of array of shadow maps (THE_NB_SHADOWMAPCUBE)
Standard_Integer myNbClipPlanesMax; //!< length of array of clipping planes (THE_MAX_CLIP_PLANES)
Standard_Integer myNbFragOutputs; //!< length of array of Fragment Shader outputs (THE_NB_FRAG_OUTPUTS)
Standard_Integer myTextureSetBits; //!< texture units declared within the program, @sa Graphic3d_TextureSetBits
Graphic3d_RenderTransparentMethod myOitOutput; //!< flag indicating that Fragment Shader includes OIT outputs
Standard_Boolean myHasDefSampler; //!< flag indicating that program defines default texture sampler occSampler0
Standard_Boolean myHasAlphaTest; //!< flag indicating that Fragment Shader performs alpha test
Standard_Boolean myIsPBR; //!< flag indicating that program defines functions and variables used in PBR pipeline
TCollection_AsciiString myID; //!< the unique identifier of program object
Graphic3d_ShaderObjectList myShaderObjects; //!< the list of attached shader objects
Graphic3d_ShaderVariableList myVariables; //!< the list of custom uniform variables
Graphic3d_ShaderAttributeList myAttributes; //!< the list of custom vertex attributes
TCollection_AsciiString myHeader; //!< GLSL header with version code and used extensions
Standard_Integer myNbLightsMax; //!< length of array of light sources (THE_MAX_LIGHTS)
Standard_Integer myNbShadowMaps; //!< length of array of shadow maps (THE_NB_SHADOWMAPS)
Standard_Integer myNbClipPlanesMax; //!< length of array of clipping planes (THE_MAX_CLIP_PLANES)
Standard_Integer myNbFragOutputs; //!< length of array of Fragment Shader outputs (THE_NB_FRAG_OUTPUTS)
Standard_Integer myTextureSetBits;//!< texture units declared within the program, @sa Graphic3d_TextureSetBits
Graphic3d_RenderTransparentMethod myOitOutput; //!< flag indicating that Fragment Shader includes OIT outputs
Standard_Boolean myHasDefSampler; //!< flag indicating that program defines default texture sampler occSampler0
Standard_Boolean myHasAlphaTest; //!< flag indicating that Fragment Shader performs alpha test
Standard_Boolean myIsPBR; //!< flag indicating that program defines functions and variables used in PBR pipeline
};

View File

@@ -67,10 +67,6 @@ enum Graphic3d_TextureUnit
//! Note that it can be overridden to Graphic3d_TextureUnit_0 for FFP fallback on hardware without multi-texturing.
Graphic3d_TextureUnit_PointSprite = Graphic3d_TextureUnit_1,
//! samplerCube occShadowCubeMapSampler.
//! Point light source shadowmap texture.
Graphic3d_TextureUnit_ShadowCubeMap = -7,
//! sampler2D occDepthPeelingDepth.
//! 1st texture unit for Depth Peeling lookups.
Graphic3d_TextureUnit_DepthPeelingDepth = -6,

View File

@@ -25,15 +25,8 @@ enum Graphic3d_TransModeFlags
Graphic3d_TMF_TriedronPers = 0x0020, //!< object behaves like trihedron - it is fixed at the corner of view and does not resizing (but rotating)
Graphic3d_TMF_2d = 0x0040, //!< object is defined in 2D screen coordinates (pixels) and does not resize, pan and rotate
Graphic3d_TMF_CameraPers = 0x0080, //!< object is in front of the camera
Graphic3d_TMF_OrthoPers = 0x0100, //!< object is forced to be rendered with orthographic projection.
Graphic3d_TMF_ZoomRotatePers = Graphic3d_TMF_ZoomPers
| Graphic3d_TMF_RotatePers //!< object doesn't resize and rotate
};
//! Bitwise OR operator for transform persistence mode flags. Be aware that some flags combinations are not valid.
inline Graphic3d_TransModeFlags operator| (Graphic3d_TransModeFlags a, Graphic3d_TransModeFlags b)
{
return static_cast<Graphic3d_TransModeFlags> (static_cast<uint32_t> (a) | static_cast<uint32_t> (b));
}
#endif

View File

@@ -58,12 +58,6 @@ public:
return (theMode & (Graphic3d_TMF_TriedronPers | Graphic3d_TMF_2d)) != 0;
}
//! Return true if specified mode is orthographic projection transformation persistence.
static Standard_Boolean IsOrthoPers (Graphic3d_TransModeFlags theMode)
{
return (theMode & Graphic3d_TMF_OrthoPers) != 0;
}
public:
//! Set transformation persistence.
@@ -116,9 +110,6 @@ public:
//! Return true for Graphic3d_TMF_TriedronPers and Graphic3d_TMF_2d modes.
Standard_Boolean IsTrihedronOr2d() const { return IsTrihedronOr2d (myMode); }
//! Return true for Graphic3d_TMF_OrthoPers mode.
Standard_Boolean IsOrthoPers () const { return IsOrthoPers (myMode); }
//! Transformation persistence mode flags.
Graphic3d_TransModeFlags Mode() const { return myMode; }
@@ -306,32 +297,28 @@ public:
//! @param theWorldView [in] the world view transformation matrix.
//! @param theViewportWidth [in] the width of viewport (for 2d persistence).
//! @param theViewportHeight [in] the height of viewport (for 2d persistence).
//! @param theToApplyProjPers [in] if should apply projection persistence to matrix (for orthographic persistence).
//! @return transformation matrix to be applied to model world transformation of an object.
template<class T>
NCollection_Mat4<T> Compute (const Handle(Graphic3d_Camera)& theCamera,
const NCollection_Mat4<T>& theProjection,
const NCollection_Mat4<T>& theWorldView,
const Standard_Integer theViewportWidth,
const Standard_Integer theViewportHeight,
const Standard_Boolean theToApplyProjPers = false) const;
const Standard_Integer theViewportHeight) const;
//! Apply transformation persistence on specified matrices.
//! @param theCamera [in] camera definition
//! @param theProjection [in] projection matrix to modify
//! @param theWorldView [in/out] world-view matrix to modify
//! @param theViewportWidth [in] viewport width
//! @param theViewportHeight [in] viewport height
//! @param theAnchor [in] if not NULL, overrides anchor point
//! @param theToApplyProjPers [in] if should apply projection persistence to matrix (for orthographic persistence).
//! @param theCamera camera definition
//! @param theProjection projection matrix to modify
//! @param theWorldView world-view matrix to modify
//! @param theViewportWidth viewport width
//! @param theViewportHeight viewport height
//! @param theAnchor if not NULL, overrides anchor point
template<class T>
void Apply (const Handle(Graphic3d_Camera)& theCamera,
const NCollection_Mat4<T>& theProjection,
NCollection_Mat4<T>& theWorldView,
const Standard_Integer theViewportWidth,
const Standard_Integer theViewportHeight,
const gp_Pnt* theAnchor = NULL,
const Standard_Boolean theToApplyProjPers = true) const;
const gp_Pnt* theAnchor = NULL) const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
@@ -381,50 +368,41 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
NCollection_Mat4<T>& theWorldView,
const Standard_Integer theViewportWidth,
const Standard_Integer theViewportHeight,
const gp_Pnt* theAnchor,
const Standard_Boolean theToApplyProjPers) const
const gp_Pnt* theAnchor) const
{
(void )theViewportWidth;
(void )theProjection;
if (myMode == Graphic3d_TMF_None
|| theViewportHeight == 0)
{
return;
}
Handle(Graphic3d_Camera) aCamera = theCamera;
if (IsOrthoPers() && !aCamera->IsOrthographic())
{
aCamera = new Graphic3d_Camera(*theCamera); // If OrthoPers, copy camera and set to orthographic projection
aCamera->SetProjectionType (Graphic3d_Camera::Projection_Orthographic);
}
NCollection_Mat4<Standard_Real> aWorldView = aCamera->OrientationMatrix();
// use total size when tiling is active
const Standard_Integer aVPSizeY = aCamera->Tile().IsValid() ? aCamera->Tile().TotalSize.y() : theViewportHeight;
const Standard_Integer aVPSizeY = theCamera->Tile().IsValid() ? theCamera->Tile().TotalSize.y() : theViewportHeight;
// a small enough jitter compensation offset
// to avoid image dragging within single pixel in corner cases
const Standard_Real aJitterComp = 0.001;
if ((myMode & Graphic3d_TMF_TriedronPers) != 0)
if (myMode == Graphic3d_TMF_TriedronPers)
{
// reset Z focus for trihedron persistence
const Standard_Real aFocus = aCamera->IsOrthographic()
? aCamera->Distance()
: (aCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
? Standard_Real(aCamera->ZFocus() * aCamera->Distance())
: Standard_Real(aCamera->ZFocus()));
const Standard_Real aFocus = theCamera->IsOrthographic()
? theCamera->Distance()
: (theCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
? Standard_Real(theCamera->ZFocus() * theCamera->Distance())
: Standard_Real(theCamera->ZFocus()));
// scale factor to pixels
const gp_XYZ aViewDim = aCamera->ViewDimensions (aFocus);
const gp_XYZ aViewDim = theCamera->ViewDimensions (aFocus);
const Standard_Real aScale = Abs(aViewDim.Y()) / Standard_Real(aVPSizeY);
const gp_Dir aForward = aCamera->Direction();
gp_XYZ aCenter = aCamera->Center().XYZ() + aForward.XYZ() * (aFocus - aCamera->Distance());
const gp_Dir aForward = theCamera->Direction();
gp_XYZ aCenter = theCamera->Center().XYZ() + aForward.XYZ() * (aFocus - theCamera->Distance());
if ((myParams.Params2d.Corner & (Aspect_TOTP_LEFT | Aspect_TOTP_RIGHT)) != 0)
{
const Standard_Real anOffsetX = (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale;
const gp_Dir aSide = aForward.Crossed (aCamera->Up());
const gp_XYZ aDeltaX = aSide.XYZ() * (Abs(aViewDim.X()) * aCamera->NDC2dOffsetX() - anOffsetX);
const gp_Dir aSide = aForward.Crossed (theCamera->Up());
const gp_XYZ aDeltaX = aSide.XYZ() * (Abs(aViewDim.X()) * theCamera->NDC2dOffsetX() - anOffsetX);
if ((myParams.Params2d.Corner & Aspect_TOTP_RIGHT) != 0)
{
aCenter += aDeltaX;
@@ -437,7 +415,7 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
if ((myParams.Params2d.Corner & (Aspect_TOTP_TOP | Aspect_TOTP_BOTTOM)) != 0)
{
const Standard_Real anOffsetY = (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale;
const gp_XYZ aDeltaY = aCamera->Up().XYZ() * (Abs(aViewDim.Y()) * aCamera->NDC2dOffsetY() - anOffsetY);
const gp_XYZ aDeltaY = theCamera->Up().XYZ() * (Abs(aViewDim.Y()) * theCamera->NDC2dOffsetY() - anOffsetY);
if ((myParams.Params2d.Corner & Aspect_TOTP_TOP) != 0)
{
aCenter += aDeltaY;
@@ -448,24 +426,27 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
}
}
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
theWorldView.ConvertFrom (aWorldView);
return;
}
else if ((myMode & Graphic3d_TMF_2d) != 0)
else if (myMode == Graphic3d_TMF_2d)
{
const Standard_Real aFocus = aCamera->IsOrthographic()
? aCamera->Distance()
: (aCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
? Standard_Real(aCamera->ZFocus() * aCamera->Distance())
: Standard_Real(aCamera->ZFocus()));
const Standard_Real aFocus = theCamera->IsOrthographic()
? theCamera->Distance()
: (theCamera->ZFocusType() == Graphic3d_Camera::FocusType_Relative
? Standard_Real(theCamera->ZFocus() * theCamera->Distance())
: Standard_Real(theCamera->ZFocus()));
// scale factor to pixels
const gp_XYZ aViewDim = aCamera->ViewDimensions (aFocus);
const gp_XYZ aViewDim = theCamera->ViewDimensions (aFocus);
const Standard_Real aScale = Abs(aViewDim.Y()) / Standard_Real(aVPSizeY);
gp_XYZ aCenter (0.0, 0.0, -aFocus);
if ((myParams.Params2d.Corner & (Aspect_TOTP_LEFT | Aspect_TOTP_RIGHT)) != 0)
{
aCenter.SetX (-aViewDim.X() * aCamera->NDC2dOffsetX() + (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale);
aCenter.SetX (-aViewDim.X() * theCamera->NDC2dOffsetX() + (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale);
if ((myParams.Params2d.Corner & Aspect_TOTP_RIGHT) != 0)
{
aCenter.SetX (-aCenter.X());
@@ -473,24 +454,26 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
}
if ((myParams.Params2d.Corner & (Aspect_TOTP_TOP | Aspect_TOTP_BOTTOM)) != 0)
{
aCenter.SetY (-aViewDim.Y() * aCamera->NDC2dOffsetY() + (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale);
aCenter.SetY (-aViewDim.Y() * theCamera->NDC2dOffsetY() + (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale);
if ((myParams.Params2d.Corner & Aspect_TOTP_TOP) != 0)
{
aCenter.SetY (-aCenter.Y());
}
}
aWorldView.InitIdentity();
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
theWorldView.InitIdentity();
Graphic3d_TransformUtils::Translate (theWorldView, T(aCenter.X()), T(aCenter.Y()), T(aCenter.Z()));
Graphic3d_TransformUtils::Scale (theWorldView, T(aScale), T(aScale), T(aScale));
return;
}
else if ((myMode & Graphic3d_TMF_CameraPers) != 0)
{
aWorldView.InitIdentity();
theWorldView.InitIdentity();
}
else
{
// Compute reference point for transformation in untransformed projection space.
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
if (theAnchor != NULL)
{
Graphic3d_TransformUtils::Translate (aWorldView, theAnchor->X(), theAnchor->Y(), theAnchor->Z());
@@ -520,19 +503,12 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
if ((myMode & Graphic3d_TMF_ZoomPers) != 0)
{
// lock zooming
Standard_Real aScale = persistentScale (aCamera, theViewportWidth, theViewportHeight);
Standard_Real aScale = persistentScale (theCamera, theViewportWidth, theViewportHeight);
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
}
theWorldView.ConvertFrom (aWorldView);
return;
}
if (!theCamera->IsOrthographic() && IsOrthoPers() && theToApplyProjPers)
{
Graphic3d_Mat4d aProjInv;
aProjInv.ConvertFrom (theProjection.Inverted());
aWorldView = (aProjInv * aCamera->ProjectionMatrix()) * aWorldView;
}
theWorldView.ConvertFrom (aWorldView);
}
// =======================================================================
@@ -579,7 +555,7 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
const Standard_Integer theViewportHeight,
BVH_Box<T, 3>& theBoundingBox) const
{
NCollection_Mat4<T> aTPers = Compute (theCamera, theProjection, theWorldView, theViewportWidth, theViewportHeight, false);
NCollection_Mat4<T> aTPers = Compute (theCamera, theProjection, theWorldView, theViewportWidth, theViewportHeight);
if (aTPers.IsIdentity()
|| !theBoundingBox.IsValid())
{
@@ -618,8 +594,7 @@ NCollection_Mat4<T> Graphic3d_TransformPers::Compute (const Handle(Graphic3d_Cam
const NCollection_Mat4<T>& theProjection,
const NCollection_Mat4<T>& theWorldView,
const Standard_Integer theViewportWidth,
const Standard_Integer theViewportHeight,
const Standard_Boolean theToApplyProjPers) const
const Standard_Integer theViewportHeight) const
{
if (myMode == Graphic3d_TMF_None)
{
@@ -635,7 +610,7 @@ NCollection_Mat4<T> Graphic3d_TransformPers::Compute (const Handle(Graphic3d_Cam
// compute only world-view matrix difference to avoid floating point instability
// caused by projection matrix modifications outside of this algorithm (e.g. by Z-fit)
Apply (theCamera, theProjection, aWorldView, theViewportWidth, theViewportHeight, NULL, theToApplyProjPers);
Apply (theCamera, theProjection, aWorldView, theViewportWidth, theViewportHeight);
return anUnviewMat * aWorldView;
}

View File

@@ -52,6 +52,10 @@ public:
const IMeshData::IFacePtr& theDFace,
const TopAbs_Orientation theOrientation) const = 0;
//! Returns an array of pcurves indices for the specified discrete face.
Standard_EXPORT virtual const IMeshData::ListOfInteger& GetPCurves (
const IMeshData::IFacePtr& theDFace) const = 0;
//! Returns pcurve with the given index.
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
const Standard_Integer theIndex) const = 0;

View File

@@ -17,6 +17,7 @@
#include <NCollection_AlignedAllocator.hxx>
#include <Standard_ProgramError.hxx>
#include <Message.hxx>
#include <algorithm>
@@ -829,6 +830,42 @@ void Image_PixMap::ToBlackWhite (Image_PixMap& theImage)
}
}
// =======================================================================
// function : ColorKeying
// purpose :
// =======================================================================
void Image_PixMap::ColorKeying(const Quantity_Color& theKey, Image_PixMap& theImage)
{
if (theImage.myImgFormat != Image_Format_RGBA && theImage.myImgFormat != Image_Format_BGRA)
{
Message::SendWarning("Warning: Image format should support alpha channel");
}
const Standard_Byte aRed = (Standard_Byte) (theKey.Red() * 255);
const Standard_Byte aGreen = (Standard_Byte) (theKey.Green() * 255);
const Standard_Byte aBlue = (Standard_Byte) (theKey.Blue() * 255);
if (theImage.myImgFormat == Image_Format_RGBA)
{
for (Standard_Size i = 0; i < theImage.myData.Size(); i += 4)
{
if (theImage.myData.ChangeData()[i] == aRed && theImage.myData.ChangeData()[i + 1] == aGreen && theImage.myData.ChangeData()[i + 2] == aBlue)
{
theImage.myData.ChangeData()[i + 3] = 0;
}
}
}
if (theImage.myImgFormat == Image_Format_BGRA)
{
for (Standard_Size i = 0; i < theImage.myData.Size(); i += 4)
{
if (theImage.myData.ChangeData()[i] == aBlue && theImage.myData.ChangeData()[i + 1] == aGreen && theImage.myData.ChangeData()[i + 2] == aRed)
{
theImage.myData.ChangeData()[i + 3] = 0;
}
}
}
}
// =======================================================================
// function : FlipY
// purpose :

View File

@@ -51,6 +51,9 @@ public:
//! Convert image to Black/White.
Standard_EXPORT static void ToBlackWhite (Image_PixMap& theImage);
//! Isolating a foreground object against a background area of uniform color
Standard_EXPORT static void ColorKeying(const Quantity_Color& theKey, Image_PixMap& theImage);
//! Reverse line order as it draws it from bottom to top.
Standard_EXPORT static bool FlipY (Image_PixMap& theImage);

View File

@@ -227,7 +227,6 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
myPBRDiffIBLMapSHTexUnit (Graphic3d_TextureUnit_PbrIblDiffuseSH),
myPBRSpecIBLMapTexUnit (Graphic3d_TextureUnit_PbrIblSpecular),
myShadowMapTexUnit (Graphic3d_TextureUnit_ShadowMap),
myShadowCubeMapTexUnit (Graphic3d_TextureUnit_ShadowCubeMap),
myDepthPeelingDepthTexUnit (Graphic3d_TextureUnit_DepthPeelingDepth),
myDepthPeelingFrontColorTexUnit (Graphic3d_TextureUnit_DepthPeelingFrontColor),
myFrameStats (new OpenGl_FrameStats()),
@@ -1654,7 +1653,6 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
}
}
myShadowCubeMapTexUnit = static_cast<Graphic3d_TextureUnit>(myMaxTexCombined + Graphic3d_TextureUnit_ShadowCubeMap); // -7
myDepthPeelingDepthTexUnit = static_cast<Graphic3d_TextureUnit>(myMaxTexCombined + Graphic3d_TextureUnit_DepthPeelingDepth); // -6
myDepthPeelingFrontColorTexUnit = static_cast<Graphic3d_TextureUnit>(myMaxTexCombined + Graphic3d_TextureUnit_DepthPeelingFrontColor); // -5
myShadowMapTexUnit = static_cast<Graphic3d_TextureUnit>(myMaxTexCombined + Graphic3d_TextureUnit_ShadowMap); // -4
@@ -1663,7 +1661,6 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
myPBRSpecIBLMapTexUnit = static_cast<Graphic3d_TextureUnit>(myMaxTexCombined + Graphic3d_TextureUnit_PbrIblSpecular); // -1
if (!myHasPBR)
{
myShadowCubeMapTexUnit = static_cast<Graphic3d_TextureUnit>(myShadowCubeMapTexUnit + 3);
myDepthPeelingDepthTexUnit = static_cast<Graphic3d_TextureUnit>(myDepthPeelingDepthTexUnit + 3);
myDepthPeelingFrontColorTexUnit = static_cast<Graphic3d_TextureUnit>(myDepthPeelingFrontColorTexUnit + 3);
myShadowMapTexUnit = static_cast<Graphic3d_TextureUnit>(myShadowMapTexUnit + 3);

View File

@@ -605,9 +605,6 @@ public:
//! Returns texture unit where shadow map is expected to be bound, or 0 if unavailable.
Graphic3d_TextureUnit ShadowMapTexUnit() const { return myShadowMapTexUnit; }
//! Returns texture unit where shadow map is expected to be bound, or 0 if unavailable.
Graphic3d_TextureUnit ShadowCubeMapTexUnit() const { return myShadowCubeMapTexUnit; }
//! Returns texture unit for occDepthPeelingDepth within enabled Depth Peeling.
Graphic3d_TextureUnit DepthPeelingDepthTexUnit() const { return myDepthPeelingDepthTexUnit; }
@@ -1140,7 +1137,6 @@ private: // context info
//! (0 if PBR is not supported)
Graphic3d_TextureUnit myPBRSpecIBLMapTexUnit; //!< samplerCube occSpecIBLMap, texture unit where specular IBL map is expected to be binded (0 if PBR is not supported)
Graphic3d_TextureUnit myShadowMapTexUnit; //!< sampler2D occShadowMapSampler
Graphic3d_TextureUnit myShadowCubeMapTexUnit; //!< samplerCube occShadowCubeMapSampler
Graphic3d_TextureUnit myDepthPeelingDepthTexUnit; //!< sampler2D occDepthPeelingDepth, texture unit for Depth Peeling lookups
Graphic3d_TextureUnit myDepthPeelingFrontColorTexUnit; //!< sampler2D occDepthPeelingFrontColor, texture unit for Depth Peeling lookups

View File

@@ -330,8 +330,7 @@ Standard_Boolean OpenGl_FrameBuffer::Init (const Handle(OpenGl_Context)& theGlCo
const Graphic3d_Vec2i& theSize,
const OpenGl_ColorFormats& theColorFormats,
const Standard_Integer theDepthFormat,
const Standard_Integer theNbSamples,
const Standard_Boolean theIsCubeMap)
const Standard_Integer theNbSamples)
{
myColorFormats = theColorFormats;
@@ -424,10 +423,9 @@ Standard_Boolean OpenGl_FrameBuffer::Init (const Handle(OpenGl_Context)& theGlCo
// extensions (GL_OES_packed_depth_stencil, GL_OES_depth_texture) + GL version might be used to determine supported formats
// instead of just trying to create such texture
Graphic3d_TypeOfTexture aTypeOfTexture = theIsCubeMap ? Graphic3d_TypeOfTexture_CUBEMAP : Graphic3d_TypeOfTexture_2D;
const OpenGl_TextureFormat aDepthFormat = OpenGl_TextureFormat::FindSizedFormat (theGlContext, myDepthFormat);
if (aDepthFormat.IsValid()
&& !myDepthStencilTexture->Init (theGlContext, aDepthFormat, Graphic3d_Vec2i (aSizeX, aSizeY), aTypeOfTexture))
&& !myDepthStencilTexture->Init (theGlContext, aDepthFormat, Graphic3d_Vec2i (aSizeX, aSizeY), Graphic3d_TypeOfTexture_2D))
{
theGlContext->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_PORTABILITY, 0, GL_DEBUG_SEVERITY_HIGH,
"Warning! Depth textures are not supported by hardware!");
@@ -472,36 +470,15 @@ Standard_Boolean OpenGl_FrameBuffer::Init (const Handle(OpenGl_Context)& theGlCo
{
if (hasDepthStencilAttach (theGlContext))
{
if (theIsCubeMap)
{
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X),
myDepthStencilTexture->TextureId(), 0);
}
else
{
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
myDepthStencilTexture->GetTarget(), myDepthStencilTexture->TextureId(), 0);
}
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
myDepthStencilTexture->GetTarget(), myDepthStencilTexture->TextureId(), 0);
}
else
{
if (theIsCubeMap)
{
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X),
myDepthStencilTexture->TextureId(), 0);
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X),
myDepthStencilTexture->TextureId(), 0);
}
else
{
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
myDepthStencilTexture->GetTarget(), myDepthStencilTexture->TextureId(), 0);
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
myDepthStencilTexture->GetTarget(), myDepthStencilTexture->TextureId(), 0);
}
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
myDepthStencilTexture->GetTarget(), myDepthStencilTexture->TextureId(), 0);
theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
myDepthStencilTexture->GetTarget(), myDepthStencilTexture->TextureId(), 0);
}
}
else if (myGlDepthRBufferId != NO_RENDERBUFFER)
@@ -522,17 +499,8 @@ Standard_Boolean OpenGl_FrameBuffer::Init (const Handle(OpenGl_Context)& theGlCo
}
}
}
const GLenum aRendImgErr = theGlContext->core11fwd->glGetError();
if (aRendImgErr != GL_NO_ERROR)
{
theGlContext->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH,
TCollection_AsciiString("Error: in setup of glFramebufferTexture2D: ") + OpenGl_Context::FormatGlError(aRendImgErr) + ".");
Release (theGlContext.get());
return Standard_False;
}
if (theGlContext->arbFBO->glCheckFramebufferStatus (GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
{
std::cout << "\n\nIncomplete framebuffer: " << theGlContext->arbFBO->glCheckFramebufferStatus (GL_FRAMEBUFFER) << "\n\n";
Release (theGlContext.operator->());
return Standard_False;
}
@@ -939,30 +907,6 @@ void OpenGl_FrameBuffer::BindReadBuffer (const Handle(OpenGl_Context)& theGlCtx)
theGlCtx->arbFBO->glBindFramebuffer (GL_READ_FRAMEBUFFER, myGlFBufferId);
}
// =======================================================================
// function : BindBufferCube
// purpose :
// =======================================================================
void OpenGl_FrameBuffer::BindBufferCube (const Handle(OpenGl_Context)& theGlCtx, const Standard_Integer theFace)
{
theGlCtx->arbFBO->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, myGlFBufferId);
if (hasDepthStencilAttach (theGlCtx))
{
theGlCtx->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X + theFace),
myDepthStencilTexture->TextureId(), 0);
}
else
{
theGlCtx->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X + theFace),
myDepthStencilTexture->TextureId(), 0);
theGlCtx->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X + theFace),
myDepthStencilTexture->TextureId(), 0);
}
}
// =======================================================================
// function : UnbindBuffer
// purpose :
@@ -1013,8 +957,7 @@ inline void convertRowFromRgba (T* theRgbRow,
Standard_Boolean OpenGl_FrameBuffer::BufferDump (const Handle(OpenGl_Context)& theGlCtx,
const Handle(OpenGl_FrameBuffer)& theFbo,
Image_PixMap& theImage,
Graphic3d_BufferType theBufferType,
const Standard_Integer theCubeFace)
Graphic3d_BufferType theBufferType)
{
if (theGlCtx.IsNull()
|| theImage.IsEmpty())
@@ -1176,38 +1119,6 @@ Standard_Boolean OpenGl_FrameBuffer::BufferDump (const Handle(OpenGl_Context)& t
return Standard_False;
}
if (theCubeFace >= 0)
{
theGlCtx->core11fwd->glBindTexture (GL_TEXTURE_CUBE_MAP, theFbo->DepthStencilTexture()->TextureId());
theFbo->BindBufferCube (theGlCtx, theCubeFace);
const GLint anAligment = Min(GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL
theGlCtx->core11fwd->glPixelStorei (GL_PACK_ALIGNMENT, anAligment);
if (theGlCtx->hasPackRowLength)
{
theGlCtx->core11fwd->glPixelStorei (GL_PACK_ROW_LENGTH, 0);
}
theGlCtx->core11fwd->glGetTexImage (GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X + theCubeFace),
0, aFormat, aType, theImage.ChangeData());
const bool hasErrors = theGlCtx->ResetErrors (true);
if (hasErrors)
{
std::cout << "\nError saving cubemap face texture to image.\n";
return Standard_False;
}
theGlCtx->core11fwd->glPixelStorei (GL_PACK_ALIGNMENT, 1);
if (!theFbo.IsNull() && theFbo->IsValid())
{
theFbo->UnbindBuffer(theGlCtx);
}
else if (theGlCtx->GraphicsLibrary() != Aspect_GraphicsLibrary_OpenGLES)
{
theGlCtx->core11fwd->glReadBuffer(aReadBufferPrev);
}
return Standard_True;
}
// bind FBO if used
if (!theFbo.IsNull() && theFbo->IsValid())
{

View File

@@ -48,13 +48,11 @@ public:
//! @param theFbo FBO to dump (or window buffer, if NULL)
//! @param theImage target image
//! @param theBufferType buffer type (attachment) to dump
//! @param theCubeFace id of the cubemap face (only used for fbo's rendering to cubemaps)
//! @return TRUE on success
Standard_EXPORT static Standard_Boolean BufferDump (const Handle(OpenGl_Context)& theGlCtx,
const Handle(OpenGl_FrameBuffer)& theFbo,
Image_PixMap& theImage,
Graphic3d_BufferType theBufferType,
const Standard_Integer theCubeFace = -1);
Graphic3d_BufferType theBufferType);
public:
@@ -144,14 +142,12 @@ public:
//! @param theColorFormats list of color texture sized format (0 means no color attachment), e.g. GL_RGBA8
//! @param theDepthFormat depth-stencil texture sized format (0 means no depth attachment), e.g. GL_DEPTH24_STENCIL8
//! @param theNbSamples MSAA number of samples (0 means normal texture)
//! @param theIsCubeMap flag to setup texture target to cubemap (FALSE by default)
//! @return true on success
Standard_EXPORT Standard_Boolean Init (const Handle(OpenGl_Context)& theGlCtx,
const Graphic3d_Vec2i& theSize,
const OpenGl_ColorFormats& theColorFormats,
const Standard_Integer theDepthFormat,
const Standard_Integer theNbSamples = 0,
const Standard_Boolean theIsCubeMap = Standard_False);
const Standard_Integer theNbSamples = 0);
//! (Re-)initialize FBO with specified dimensions.
Standard_EXPORT Standard_Boolean InitLazy (const Handle(OpenGl_Context)& theGlCtx,
@@ -229,9 +225,6 @@ public:
//! Bind frame buffer for reading GL_READ_FRAMEBUFFER
Standard_EXPORT virtual void BindReadBuffer (const Handle(OpenGl_Context)& theGlCtx);
//! Bind frame buffer for reading cubemap with the target @theFace.
Standard_EXPORT virtual void BindBufferCube (const Handle(OpenGl_Context)& theGlCtx, const Standard_Integer theFace);
//! Unbind frame buffer.
Standard_EXPORT virtual void UnbindBuffer (const Handle(OpenGl_Context)& theGlCtx);

View File

@@ -15,7 +15,6 @@
#include <OpenGl_ShaderManager.hxx>
#include <Graphic3d_Camera.hxx>
#include <Graphic3d_CubeMapPacked.hxx>
#include <Graphic3d_TextureParams.hxx>
#include <OpenGl_Aspects.hxx>
@@ -555,10 +554,9 @@ void OpenGl_ShaderManager::pushLightSourceState (const Handle(OpenGl_ShaderProgr
// update shadow map variables
if (const OpenGl_ShaderUniformLocation aShadowMatLoc = theProgram->GetStateLocation (OpenGl_OCC_LIGHT_SHADOWMAP_MATRICES))
{
Standard_Integer aNbShadowMaps = theProgram->NbShadowMaps() + theProgram->NbShadowCubeMaps();
if (myShadowMatArray.Size() < aNbShadowMaps)
if (myShadowMatArray.Size() < theProgram->NbShadowMaps())
{
myShadowMatArray.Resize (0, aNbShadowMaps - 1, false);
myShadowMatArray.Resize (0, theProgram->NbShadowMaps() - 1, false);
}
Graphic3d_Vec2 aSizeBias;
@@ -566,7 +564,7 @@ void OpenGl_ShaderManager::pushLightSourceState (const Handle(OpenGl_ShaderProgr
{
aSizeBias.SetValues (1.0f / (float )myLightSourceState.ShadowMaps()->First()->Texture()->SizeX(),
myLightSourceState.ShadowMaps()->First()->ShadowMapBias());
const Standard_Integer aNbShadows = Min (aNbShadowMaps, myLightSourceState.ShadowMaps()->Size());
const Standard_Integer aNbShadows = Min (theProgram->NbShadowMaps(), myLightSourceState.ShadowMaps()->Size());
for (Standard_Integer aShadowIter = 0; aShadowIter < aNbShadows; ++aShadowIter)
{
const Handle(OpenGl_ShadowMap)& aShadow = myLightSourceState.ShadowMaps()->Value (aShadowIter);
@@ -574,28 +572,9 @@ void OpenGl_ShaderManager::pushLightSourceState (const Handle(OpenGl_ShaderProgr
}
}
theProgram->SetUniform (myContext, aShadowMatLoc, aNbShadowMaps, &myShadowMatArray.First());
theProgram->SetUniform (myContext, aShadowMatLoc, theProgram->NbShadowMaps(), &myShadowMatArray.First());
theProgram->SetUniform (myContext, theProgram->GetStateLocation (OpenGl_OCC_LIGHT_SHADOWMAP_SIZE_BIAS), aSizeBias);
}
if (const OpenGl_ShaderUniformLocation aShadowRangeLoc = theProgram->GetStateLocation (OpenGl_OCC_LIGHT_SHADOWMAP_RANGEPARAMS))
{
Standard_Integer aNbShadowMaps = theProgram->NbShadowMaps() + theProgram->NbShadowCubeMaps();
if (myShadowRangeArray.Size() < aNbShadowMaps)
{
myShadowRangeArray.Resize (0, aNbShadowMaps - 1, false);
}
if (myLightSourceState.HasShadowMaps())
{
const Standard_Integer aNbShadows = Min (aNbShadowMaps, myLightSourceState.ShadowMaps()->Size());
for (Standard_Integer aShadowIter = 0; aShadowIter < aNbShadows; ++aShadowIter)
{
const Handle(OpenGl_ShadowMap)& aShadow = myLightSourceState.ShadowMaps()->Value (aShadowIter);
myShadowRangeArray[aShadowIter] = Graphic3d_Vec2 (aShadow->Camera()->ZNear(), aShadow->Camera()->ZFar());
}
}
theProgram->SetUniform (myContext, aShadowRangeLoc, aNbShadowMaps, &myShadowRangeArray.First());
}
}
// =======================================================================
@@ -1250,16 +1229,10 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramPhong (Handle(OpenGl_Sha
const Standard_Boolean theIsFlatNormal,
const Standard_Boolean theIsPBR)
{
Standard_Integer aNbShadowMaps, aNbShadowCubeMaps;
myLightSourceState.LightSources()->CalculateNbShadows (aNbShadowMaps, aNbShadowCubeMaps);
// point light shadows are not currently supported on opengles 2.0.
if (myContext->GraphicsLibrary() == Aspect_GraphicsLibrary_OpenGLES
&& myContext->VersionMajor() <= 2)
{
aNbShadowCubeMaps = 0;
}
Handle(Graphic3d_ShaderProgram) aProgramSrc = getStdProgramPhong (myLightSourceState.LightSources(), theBits, theIsFlatNormal,
theIsPBR, aNbShadowMaps, aNbShadowCubeMaps);
Standard_Integer aNbShadowMaps = myLightSourceState.HasShadowMaps()
? myLightSourceState.LightSources()->NbCastShadows()
: 0;
Handle(Graphic3d_ShaderProgram) aProgramSrc = getStdProgramPhong (myLightSourceState.LightSources(), theBits, theIsFlatNormal, theIsPBR, aNbShadowMaps);
TCollection_AsciiString aKey;
if (!Create (aProgramSrc, aKey, theProgram))
{

View File

@@ -801,7 +801,6 @@ protected:
mutable NCollection_Array1<Standard_Integer> myLightTypeArray;
mutable NCollection_Array1<OpenGl_ShaderLightParameters> myLightParamsArray;
mutable NCollection_Array1<Graphic3d_Mat4> myShadowMatArray;
mutable NCollection_Array1<Graphic3d_Vec2> myShadowRangeArray;
mutable NCollection_Array1<OpenGl_Vec4> myClipPlaneArray;
mutable NCollection_Array1<OpenGl_Vec4d> myClipPlaneArrayFfp;
mutable NCollection_Array1<Standard_Integer> myClipChainArray;

View File

@@ -50,45 +50,43 @@ Standard_CString OpenGl_ShaderProgram::PredefinedKeywords[] =
"occWorldViewMatrixInverseTranspose", // OpenGl_OCC_WORLD_VIEW_MATRIX_INVERSE_TRANSPOSE
"occProjectionMatrixInverseTranspose", // OpenGl_OCC_PROJECTION_MATRIX_INVERSE_TRANSPOSE
"occClipPlaneEquations", // OpenGl_OCC_CLIP_PLANE_EQUATIONS
"occClipPlaneChains", // OpenGl_OCC_CLIP_PLANE_CHAINS
"occClipPlaneCount", // OpenGl_OCC_CLIP_PLANE_COUNT
"occClipPlaneEquations", // OpenGl_OCC_CLIP_PLANE_EQUATIONS
"occClipPlaneChains", // OpenGl_OCC_CLIP_PLANE_CHAINS
"occClipPlaneCount", // OpenGl_OCC_CLIP_PLANE_COUNT
"occLightSourcesCount", // OpenGl_OCC_LIGHT_SOURCE_COUNT
"occLightSourcesTypes", // OpenGl_OCC_LIGHT_SOURCE_TYPES
"occLightSources", // OpenGl_OCC_LIGHT_SOURCE_PARAMS
"occLightAmbient", // OpenGl_OCC_LIGHT_AMBIENT
"occShadowMapSizeBias", // OpenGl_OCC_LIGHT_SHADOWMAP_SIZE_BIAS
"occShadowMapSamplers", // OpenGl_OCC_LIGHT_SHADOWMAP_SAMPLERS,
"occShadowCubeMapSamplers", // OpenGl_OCC_LIGHT_SHADOWCUBEMAP_SAMPLERS,
"occShadowMapMatrices", // OpenGl_OCC_LIGHT_SHADOWMAP_MATRICES,
"occShadowMapRangeParams", // OpenGl_OCC_LIGHT_SHADOWMAP_RANGEPARAMS,
"occLightSourcesCount", // OpenGl_OCC_LIGHT_SOURCE_COUNT
"occLightSourcesTypes", // OpenGl_OCC_LIGHT_SOURCE_TYPES
"occLightSources", // OpenGl_OCC_LIGHT_SOURCE_PARAMS
"occLightAmbient", // OpenGl_OCC_LIGHT_AMBIENT
"occShadowMapSizeBias", // OpenGl_OCC_LIGHT_SHADOWMAP_SIZE_BIAS
"occShadowMapSamplers", // OpenGl_OCC_LIGHT_SHADOWMAP_SAMPLERS,
"occShadowMapMatrices", // OpenGl_OCC_LIGHT_SHADOWMAP_MATRICES,
"occTextureEnable", // OpenGl_OCCT_TEXTURE_ENABLE
"occDistinguishingMode", // OpenGl_OCCT_DISTINGUISH_MODE
"occPbrMaterial", // OpenGl_OCCT_PBR_MATERIAL
"occCommonMaterial", // OpenGl_OCCT_COMMON_MATERIAL
"occAlphaCutoff", // OpenGl_OCCT_ALPHA_CUTOFF
"occColor", // OpenGl_OCCT_COLOR
"occTextureEnable", // OpenGl_OCCT_TEXTURE_ENABLE
"occDistinguishingMode", // OpenGl_OCCT_DISTINGUISH_MODE
"occPbrMaterial", // OpenGl_OCCT_PBR_MATERIAL
"occCommonMaterial", // OpenGl_OCCT_COMMON_MATERIAL
"occAlphaCutoff", // OpenGl_OCCT_ALPHA_CUTOFF
"occColor", // OpenGl_OCCT_COLOR
"occOitOutput", // OpenGl_OCCT_OIT_OUTPUT
"occOitDepthFactor", // OpenGl_OCCT_OIT_DEPTH_FACTOR
"occOitOutput", // OpenGl_OCCT_OIT_OUTPUT
"occOitDepthFactor", // OpenGl_OCCT_OIT_DEPTH_FACTOR
"occTexTrsf2d", // OpenGl_OCCT_TEXTURE_TRSF2D
"occPointSize", // OpenGl_OCCT_POINT_SIZE
"occTexTrsf2d", // OpenGl_OCCT_TEXTURE_TRSF2D
"occPointSize", // OpenGl_OCCT_POINT_SIZE
"occViewport", // OpenGl_OCCT_VIEWPORT
"occLineWidth", // OpenGl_OCCT_LINE_WIDTH
"occLineFeather", // OpenGl_OCCT_LINE_FEATHER
"occStipplePattern", // OpenGl_OCCT_LINE_STIPPLE_PATTERN
"occStippleFactor", // OpenGl_OCCT_LINE_STIPPLE_FACTOR
"occWireframeColor", // OpenGl_OCCT_WIREFRAME_COLOR
"occIsQuadMode", // OpenGl_OCCT_QUAD_MODE_STATE
"occViewport", // OpenGl_OCCT_VIEWPORT
"occLineWidth", // OpenGl_OCCT_LINE_WIDTH
"occLineFeather", // OpenGl_OCCT_LINE_FEATHER
"occStipplePattern", // OpenGl_OCCT_LINE_STIPPLE_PATTERN
"occStippleFactor", // OpenGl_OCCT_LINE_STIPPLE_FACTOR
"occWireframeColor", // OpenGl_OCCT_WIREFRAME_COLOR
"occIsQuadMode", // OpenGl_OCCT_QUAD_MODE_STATE
"occOrthoScale", // OpenGl_OCCT_ORTHO_SCALE
"occSilhouetteThickness", // OpenGl_OCCT_SILHOUETTE_THICKNESS
"occOrthoScale", // OpenGl_OCCT_ORTHO_SCALE
"occSilhouetteThickness", // OpenGl_OCCT_SILHOUETTE_THICKNESS
"occNbSpecIBLLevels" // OpenGl_OCCT_NB_SPEC_IBL_LEVELS
"occNbSpecIBLLevels" // OpenGl_OCCT_NB_SPEC_IBL_LEVELS
};
namespace
@@ -167,7 +165,6 @@ OpenGl_ShaderProgram::OpenGl_ShaderProgram (const Handle(Graphic3d_ShaderProgram
myShareCount(1),
myNbLightsMax (0),
myNbShadowMaps (0),
myNbShadowCubeMaps (0),
myNbClipPlanesMax (0),
myNbFragOutputs (1),
myTextureSetBits (Graphic3d_TextureSetBits_NONE),
@@ -422,24 +419,15 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)&
}
TCollection_AsciiString aHeaderConstants;
myNbLightsMax = !myProxy.IsNull() ? myProxy->NbLightsMax() : 0;
myNbShadowMaps = !myProxy.IsNull() ? myProxy->NbShadowMaps() : 0;
myNbShadowCubeMaps = !myProxy.IsNull() ? myProxy->NbShadowCubeMaps() : 0;
myNbClipPlanesMax = !myProxy.IsNull() ? myProxy->NbClipPlanesMax() : 0;
myNbLightsMax = !myProxy.IsNull() ? myProxy->NbLightsMax() : 0;
myNbShadowMaps = !myProxy.IsNull() ? myProxy->NbShadowMaps() : 0;
myNbClipPlanesMax = !myProxy.IsNull() ? myProxy->NbClipPlanesMax() : 0;
aHeaderConstants += TCollection_AsciiString("#define THE_MAX_LIGHTS ") + myNbLightsMax + "\n";
aHeaderConstants += TCollection_AsciiString("#define THE_MAX_CLIP_PLANES ") + myNbClipPlanesMax + "\n";
aHeaderConstants += TCollection_AsciiString("#define THE_NB_FRAG_OUTPUTS ") + myNbFragOutputs + "\n";
if (myNbShadowMaps + myNbShadowCubeMaps > 0)
{
aHeaderConstants += TCollection_AsciiString("#define THE_NB_SHADOWMAPS ") + (myNbShadowMaps + myNbShadowCubeMaps) + "\n";
}
if (myNbShadowMaps > 0)
{
aHeaderConstants += TCollection_AsciiString("#define THE_NB_SHADOWMAPS2D ") + myNbShadowMaps + "\n";
}
if (myNbShadowCubeMaps > 0)
{
aHeaderConstants += TCollection_AsciiString("#define THE_NB_SHADOWMAPSCUBE ") + myNbShadowCubeMaps + "\n";
aHeaderConstants += TCollection_AsciiString("#define THE_NB_SHADOWMAPS ") + myNbShadowMaps + "\n";
}
if (theCtx->caps->useZeroToOneDepth
&& theCtx->arbClipControl)
@@ -602,16 +590,7 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)&
}
SetUniform (theCtx, aLocSampler, myNbShadowMaps, &aShadowSamplers.front());
}
if (const OpenGl_ShaderUniformLocation aLocSampler = GetUniformLocation (theCtx, "occShadowCubeMapSamplers"))
{
std::vector<GLint> aShadowSamplers (myNbShadowCubeMaps);
const GLint aSamplFrom = GLint(theCtx->ShadowCubeMapTexUnit()) - myNbShadowCubeMaps + 1;
for (Standard_Integer aSamplerIter = 0; aSamplerIter < myNbShadowCubeMaps; ++aSamplerIter)
{
aShadowSamplers[aSamplerIter] = aSamplFrom + aSamplerIter;
}
SetUniform (theCtx, aLocSampler, myNbShadowCubeMaps, &aShadowSamplers.front());
}
if (const OpenGl_ShaderUniformLocation aLocSampler = GetUniformLocation (theCtx, "occDepthPeelingDepth"))
{
SetUniform (theCtx, aLocSampler, GLint(theCtx->DepthPeelingDepthTexUnit()));

View File

@@ -57,11 +57,9 @@ enum OpenGl_StateVariable
OpenGl_OCC_LIGHT_SOURCE_TYPES,
OpenGl_OCC_LIGHT_SOURCE_PARAMS,
OpenGl_OCC_LIGHT_AMBIENT,
OpenGl_OCC_LIGHT_SHADOWMAP_SIZE_BIAS, // occShadowMapSizeBias
OpenGl_OCC_LIGHT_SHADOWMAP_SAMPLERS, // occShadowMapSamplers
OpenGl_OCC_LIGHT_SHADOWCUBEMAP_SAMPLERS, // occShadowCubeMapSamplers
OpenGl_OCC_LIGHT_SHADOWMAP_MATRICES, // occShadowMapMatrices
OpenGl_OCC_LIGHT_SHADOWMAP_RANGEPARAMS, // occShadowMapRangeParams
OpenGl_OCC_LIGHT_SHADOWMAP_SIZE_BIAS,// occShadowMapSizeBias
OpenGl_OCC_LIGHT_SHADOWMAP_SAMPLERS, // occShadowMapSamplers
OpenGl_OCC_LIGHT_SHADOWMAP_MATRICES, // occShadowMapMatrices
// Material state
OpenGl_OCCT_TEXTURE_ENABLE,
@@ -285,12 +283,9 @@ public:
//! to be used for initialization occLightSources (OpenGl_OCC_LIGHT_SOURCE_PARAMS).
Standard_Integer NbLightsMax() const { return myNbLightsMax; }
//! Return the length of array of 2D shadow maps (THE_NB_SHADOWMAP2D); 0 by default.
//! Return the length of array of shadow maps (THE_NB_SHADOWMAPS); 0 by default.
Standard_Integer NbShadowMaps() const { return myNbShadowMaps; }
//! Return the length of array of shadow cube maps (THE_NB_SHADOWMAPCUBE); 0 by default.
Standard_Integer NbShadowCubeMaps() const { return myNbShadowCubeMaps; }
//! Return the length of array of clipping planes (THE_MAX_CLIP_PLANES),
//! to be used for initialization occClipPlaneEquations (OpenGl_OCC_CLIP_PLANE_EQUATIONS) and occClipPlaneChains (OpenGl_OCC_CLIP_PLANE_CHAINS).
Standard_Integer NbClipPlanesMax() const { return myNbClipPlanesMax; }
@@ -648,19 +643,18 @@ protected:
protected:
GLuint myProgramID; //!< Handle of OpenGL shader program
OpenGl_ShaderList myShaderObjects; //!< List of attached shader objects
Handle(Graphic3d_ShaderProgram) myProxy; //!< Proxy shader program (from application layer)
Standard_Integer myShareCount; //!< program users count, initialized with 1 (already shared by one user)
Standard_Integer myNbLightsMax; //!< length of array of light sources (THE_MAX_LIGHTS)
Standard_Integer myNbShadowMaps; //!< length of array of shadow maps (THE_NB_SHADOWMAP2D)
Standard_Integer myNbShadowCubeMaps; //!< length of array of shadow maps (THE_NB_SHADOWMAPCUBE)
Standard_Integer myNbClipPlanesMax; //!< length of array of clipping planes (THE_MAX_CLIP_PLANES)
Standard_Integer myNbFragOutputs; //!< length of array of Fragment Shader outputs (THE_NB_FRAG_OUTPUTS)
Standard_Integer myTextureSetBits; //!< texture units declared within the program, @sa Graphic3d_TextureSetBits
Graphic3d_RenderTransparentMethod myOitOutput; //!< flag indicating that Fragment Shader includes OIT outputs
Standard_Boolean myHasAlphaTest; //!< flag indicating that Fragment Shader should perform alpha-test
Standard_Boolean myHasTessShader; //!< flag indicating that program defines tessellation stage
GLuint myProgramID; //!< Handle of OpenGL shader program
OpenGl_ShaderList myShaderObjects; //!< List of attached shader objects
Handle(Graphic3d_ShaderProgram) myProxy; //!< Proxy shader program (from application layer)
Standard_Integer myShareCount; //!< program users count, initialized with 1 (already shared by one user)
Standard_Integer myNbLightsMax; //!< length of array of light sources (THE_MAX_LIGHTS)
Standard_Integer myNbShadowMaps; //!< length of array of shadow maps (THE_NB_SHADOWMAPS)
Standard_Integer myNbClipPlanesMax; //!< length of array of clipping planes (THE_MAX_CLIP_PLANES)
Standard_Integer myNbFragOutputs; //!< length of array of Fragment Shader outputs (THE_NB_FRAG_OUTPUTS)
Standard_Integer myTextureSetBits;//!< texture units declared within the program, @sa Graphic3d_TextureSetBits
Graphic3d_RenderTransparentMethod myOitOutput; //!< flag indicating that Fragment Shader includes OIT outputs
Standard_Boolean myHasAlphaTest; //!< flag indicating that Fragment Shader should perform alpha-test
Standard_Boolean myHasTessShader; //!< flag indicating that program defines tessellation stage
protected:

View File

@@ -83,8 +83,7 @@ const Handle(OpenGl_Texture)& OpenGl_ShadowMap::Texture() const
// purpose :
// =======================================================================
bool OpenGl_ShadowMap::UpdateCamera (const Graphic3d_CView& theView,
const gp_XYZ* theOrigin,
const Standard_Integer theFace)
const gp_XYZ* theOrigin)
{
const Bnd_Box aMinMaxBox = theOrigin == NULL ? theView.MinMaxValues (false) : Bnd_Box(); // applicative min max boundaries
const Bnd_Box aGraphicBox = aMinMaxBox;
@@ -135,18 +134,7 @@ bool OpenGl_ShadowMap::UpdateCamera (const Graphic3d_CView& theView,
case Graphic3d_TypeOfLightSource_Positional:
{
// render into cubemap shadowmap texture
myShadowCamera->SetZeroToOneDepth (theView.Camera()->IsZeroToOneDepth());
myShadowCamera->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
myShadowCamera->SetFOVy (90.0);
myShadowCamera->MoveEyeTo (myShadowLight->Position());
// calculate direction and up vector for the given cubemap face
myShadowCamera->SetDirectionFromEye (Graphic3d_CubeMap::GetCubeDirection ((Graphic3d_CubeMapSide)theFace));
myShadowCamera->SetUp (Graphic3d_CubeMap::GetCubeUp ((Graphic3d_CubeMapSide)theFace));
// setup znear and zfar (default value)
myShadowCamera->SetZRange (1.0, myShadowLight->Range() <= 1.0 ? Graphic3d_Camera::GetDefaultZFar() : myShadowLight->Range());
myLightMatrix = myShadowCamera->ProjectionMatrixF() * myShadowCamera->OrientationMatrixF();
return true;
return false; // not implemented
}
case Graphic3d_TypeOfLightSource_Spot:
{

View File

@@ -76,10 +76,8 @@ public:
//! Compute camera.
//! @param theView [in] active view
//! @param theOrigin [in] when not-NULL - displace shadow map camera to specified Z-Layer origin
//! @param theFace [in] if light is point light calculate for given cubemap face index
Standard_EXPORT bool UpdateCamera (const Graphic3d_CView& theView,
const gp_XYZ* theOrigin = NULL,
const Standard_Integer theFace = -1);
const gp_XYZ* theOrigin = NULL);
private:

View File

@@ -443,6 +443,7 @@ bool OpenGl_Texture::Init (const Handle(OpenGl_Context)& theCtx,
return false;
}
}
theCtx->core11fwd->glTexImage2D (GL_TEXTURE_2D, 0, anIntFormat,
theSizeXYZ.x(), theSizeXYZ.y(), 0,
theFormat.PixelFormat(), theFormat.DataType(), aDataPtr);
@@ -519,48 +520,9 @@ bool OpenGl_Texture::Init (const Handle(OpenGl_Context)& theCtx,
}
case Graphic3d_TypeOfTexture_CUBEMAP:
{
Bind (theCtx);
applyDefaultSamplerParams (theCtx);
if (theCtx->GraphicsLibrary() == Aspect_GraphicsLibrary_OpenGL)
{
// use proxy to check texture could be created or not
theCtx->core11fwd->glTexImage2D (GL_PROXY_TEXTURE_CUBE_MAP, 0, anIntFormat,
theSizeXYZ.x(), theSizeXYZ.y(), 0,
theFormat.PixelFormat(), theFormat.DataType(), NULL);
theCtx->core11fwd->glGetTexLevelParameteriv (GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_TEXTURE_WIDTH, &aTestWidth);
theCtx->core11fwd->glGetTexLevelParameteriv (GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_TEXTURE_HEIGHT, &aTestHeight);
theCtx->core11fwd->glGetTexLevelParameteriv (GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_TEXTURE_INTERNAL_FORMAT, &mySizedFormat);
if (aTestWidth == 0 || aTestHeight == 0)
{
// no memory or broken input parameters
Unbind(theCtx);
Release(theCtx.get());
return false;
}
}
for (Standard_Integer aCubeIndex = 0; aCubeIndex < 6; ++aCubeIndex)
{
theCtx->core11fwd->glTexImage2D (GLenum(GL_TEXTURE_CUBE_MAP_POSITIVE_X + aCubeIndex), 0, anIntFormat,
theSizeXYZ.x(), theSizeXYZ.y(), 0,
theFormat.PixelFormat(), theFormat.DataType(), aDataPtr);
GLenum anErr = theCtx->core11fwd->glGetError();
if (anErr != GL_NO_ERROR)
{
theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH,
TCollection_AsciiString ("Error: Cubemap texture ") + theSizeXYZ.x() + "x" + theSizeXYZ.y()
+ " IF: " + OpenGl_TextureFormat::FormatFormat (anIntFormat)
+ " PF: " + OpenGl_TextureFormat::FormatFormat (theFormat.PixelFormat())
+ " DT: " + OpenGl_TextureFormat::FormatDataType (theFormat.DataType())
+ " can not be created with error " + OpenGl_Context::FormatGlError (anErr)
+ " [" + myResourceId + "]");
Unbind (theCtx);
Release (theCtx.get());
return false;
}
}
mySize.SetValues (theSizeXYZ.xy(), 1);
break;
Unbind (theCtx);
Release (theCtx.get());
return false;
}
}

View File

@@ -1583,73 +1583,31 @@ bool OpenGl_View::prepareFrameBuffers (Graphic3d_Camera::Projection& theProj)
&& myRenderParams.Method != Graphic3d_RM_RAYTRACING;
if (toUseShadowMap)
{
Standard_Integer aNbShadows = 0;
Standard_Integer aNbPointShadows = 0;
Standard_Boolean aToReviewLights = Standard_False;
for (Graphic3d_LightSet::Iterator aLightIter(myLights); aLightIter.More(); aLightIter.Next())
{
Handle(Graphic3d_CLight) aLight = aLightIter.Value();
if (aLight->Type() == Graphic3d_TypeOfLightSource_Positional)
{
// point lights shadows are not currently supported on opengles 2.0
if (aCtx->GraphicsLibrary() == Aspect_GraphicsLibrary_OpenGLES
&& aCtx->VersionMajor() <= 2)
{
aLight->SetCastShadows (Standard_False);
aToReviewLights = Standard_True;
}
else if (aLight->ToCastShadows())
{
++aNbPointShadows;
}
}
else
{
if (aLight->ToCastShadows())
{
++aNbShadows;
}
}
}
if (aToReviewLights)
{
myLights->UpdateRevision();
}
if (myShadowMaps->Size() != myLights->NbCastShadows())
{
myShadowMaps->Release (aCtx.get());
myShadowMaps->Resize (0, myLights->NbCastShadows() - 1, true);
}
const GLint aSampleFrom = GLint(aCtx->ShadowMapTexUnit()) - myLights->NbCastShadows() + aNbPointShadows + 1;
const GLint aSampleCubeFrom = GLint(aCtx->ShadowCubeMapTexUnit()) - aNbPointShadows + 1;
Standard_Integer aLightIndex = 0;
Standard_Integer a2DShadowIndex = 0;
Standard_Integer aCubeShadowIndex = 0;
for (Graphic3d_LightSet::Iterator aLightIter(myLights); aLightIter.More(); aLightIter.Next())
const GLint aSamplFrom = GLint(aCtx->ShadowMapTexUnit()) - myLights->NbCastShadows() + 1;
for (Standard_Integer aShadowIter = 0; aShadowIter < myShadowMaps->Size(); ++aShadowIter)
{
Handle(Graphic3d_CLight) aLight = aLightIter.Value();
if (aLight->ToCastShadows())
Handle(OpenGl_ShadowMap)& aShadow = myShadowMaps->ChangeValue (aShadowIter);
if (aShadow.IsNull())
{
Handle(OpenGl_ShadowMap)& aShadow = myShadowMaps->ChangeValue (aLightIndex++);
if (aShadow.IsNull())
aShadow = new OpenGl_ShadowMap();
}
aShadow->SetShadowMapBias (myRenderParams.ShadowMapBias);
aShadow->Texture()->Sampler()->Parameters()->SetTextureUnit ((Graphic3d_TextureUnit )(aSamplFrom + aShadowIter));
const Handle(OpenGl_FrameBuffer)& aShadowFbo = aShadow->FrameBuffer();
if (aShadowFbo->GetVPSizeX() != myRenderParams.ShadowMapResolution
&& toUseShadowMap)
{
OpenGl_ColorFormats aDummy;
if (!aShadowFbo->Init (aCtx, Graphic3d_Vec2i (myRenderParams.ShadowMapResolution), aDummy, myFboDepthFormat, 0))
{
aShadow = new OpenGl_ShadowMap();
}
aShadow->SetShadowMapBias (myRenderParams.ShadowMapBias);
Standard_Integer aTexUnit = aLight->Type() == Graphic3d_TypeOfLightSource_Positional
? aSampleCubeFrom + aCubeShadowIndex++
: aSampleFrom + a2DShadowIndex++;
aShadow->Texture()->Sampler()->Parameters()->SetTextureUnit ((Graphic3d_TextureUnit)(aTexUnit));
const Handle(OpenGl_FrameBuffer)& aShadowFbo = aShadow->FrameBuffer();
if (aShadowFbo->GetVPSizeX() != myRenderParams.ShadowMapResolution
&& toUseShadowMap)
{
OpenGl_ColorFormats aDummy;
if (!aShadowFbo->Init (aCtx, Graphic3d_Vec2i(myRenderParams.ShadowMapResolution), aDummy, myFboDepthFormat, 0,
aLight->Type() == Graphic3d_TypeOfLightSource_Positional))
{
toUseShadowMap = false;
}
toUseShadowMap = false;
}
}
}
@@ -1730,22 +1688,7 @@ void OpenGl_View::Redraw()
{
const Handle(OpenGl_ShadowMap)& aShadowMap = myShadowMaps->ChangeValue (aShadowIndex);
aShadowMap->SetLightSource (aLight);
if (aLight->Type() == Graphic3d_TypeOfLightSource_Positional)
{
// cube shadow maps are not currently working on opengles 2.0.
if (aCtx->GraphicsLibrary() != Aspect_GraphicsLibrary_OpenGLES
|| aCtx->VersionMajor() >= 3)
{
for (Standard_Integer aCubeFace = 0; aCubeFace < 6; ++aCubeFace)
{
renderShadowMap (aShadowMap, aCubeFace);
}
}
}
else
{
renderShadowMap (aShadowMap, -1);
}
renderShadowMap (aShadowMap);
++aShadowIndex;
}
}
@@ -2354,11 +2297,10 @@ bool OpenGl_View::blitSubviews (const Graphic3d_Camera::Projection ,
//function : renderShadowMap
//purpose :
//=======================================================================
void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap,
const Standard_Integer theFace)
void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap)
{
const Handle(OpenGl_Context)& aCtx = myWorkspace->GetGlContext();
if (!theShadowMap->UpdateCamera (*this, NULL, theFace))
if (!theShadowMap->UpdateCamera (*this))
{
return;
}
@@ -2377,14 +2319,7 @@ void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap,
aCtx->ShaderManager()->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
const Handle(OpenGl_FrameBuffer)& aShadowBuffer = theShadowMap->FrameBuffer();
if (theFace < 0)
{
aShadowBuffer->BindBuffer (aCtx);
}
else
{
aShadowBuffer->BindBufferCube (aCtx, theFace);
}
aShadowBuffer->BindBuffer (aCtx);
aShadowBuffer->SetupViewport (aCtx);
aCtx->SetColorMask (false);
@@ -2394,9 +2329,9 @@ void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap,
myWorkspace->UseZBuffer() = true;
myWorkspace->UseDepthWrite() = true;
aCtx->core11fwd->glDepthFunc (GL_LEQUAL);
aCtx->core11fwd->glDepthMask (GL_TRUE);
aCtx->core11fwd->glEnable (GL_DEPTH_TEST);
aCtx->core11fwd->glClearDepth (1.0);
aCtx->core11fwd->glDepthMask (GL_TRUE);
aCtx->core11fwd->glClear (GL_DEPTH_BUFFER_BIT);
Graphic3d_Camera::Projection aProjection = theShadowMap->LightSource()->Type() == Graphic3d_TypeOfLightSource_Directional
@@ -2410,9 +2345,10 @@ void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap,
myWorkspace->ResetAppliedAspect();
aCtx->BindProgram (Handle(OpenGl_ShaderProgram)());
//Image_AlienPixMap anImage; anImage.InitZero (Image_Format_GrayF, aShadowBuffer->GetVPSizeX(), aShadowBuffer->GetVPSizeY());
//OpenGl_FrameBuffer::BufferDump (aCtx, aShadowBuffer, anImage, Graphic3d_BT_Depth);
//anImage.Save (TCollection_AsciiString("shadow") + theShadowMap->Texture()->Sampler()->Parameters()->TextureUnit() + ".png");
//Image_AlienPixMap anImage; anImage.InitZero (Image_Format_Gray, aShadowBuffer->GetVPSizeX(), aShadowBuffer->GetVPSizeY());
//OpenGl_FrameBuffer::BufferDump (aCtx, aShadowBuffer, anImage, Graphic3d_BT_Depth);
//anImage.Save (TCollection_AsciiString ("shadow") + theShadowMap->Texture()->Sampler()->Parameters()->TextureUnit() + ".png");
bindDefaultFbo();
}

View File

@@ -354,9 +354,7 @@ protected: //! @name Rendering of GL graphics (with prepared drawing buffer).
//! Renders the graphical contents of the view into the preprepared shadowmap framebuffer.
//! @param theShadowMap [in] the framebuffer for rendering shadowmap.
//! @param theFace [in] value for cubemap face.
Standard_EXPORT virtual void renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap,
const Standard_Integer theFace);
Standard_EXPORT virtual void renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap);
//! Renders the graphical contents of the view into the preprepared window or framebuffer.
//! @param theProjection [in] the projection that should be used for rendering.

View File

@@ -16,74 +16,72 @@
#include <RWStepBasic_RWConversionBasedUnit.hxx>
#include <StepBasic_ConversionBasedUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
RWStepBasic_RWConversionBasedUnit::RWStepBasic_RWConversionBasedUnit () {}
void RWStepBasic_RWConversionBasedUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnit)& ent) const
void RWStepBasic_RWConversionBasedUnit::ReadStep(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnit)& ent) const
{
// --- Number of Parameter Control ---
// --- Number of Parameter Control ---
if (!data->CheckNbParams(num,3,ach,"conversion_based_unit")) return;
if (!data->CheckNbParams(num,3,ach,"conversion_based_unit")) return;
// --- inherited field : dimensions ---
// --- inherited field : dimensions ---
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
// --- own field : name ---
// --- own field : name ---
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadString (num,2,"name",ach,aName);
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadString (num,2,"name",ach,aName);
// --- own field : conversionFactor ---
// --- own field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 3,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 3, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
//--- Initialisation of the read entity ---
//--- Initialisation of the read entity ---
ent->Init(aDimensions, aName, aConversionFactor);
ent->Init(aDimensions, aName, aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnit::WriteStep
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnit)& ent) const
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnit)& ent) const
{
// --- inherited field dimensions ---
// --- inherited field dimensions ---
SW.Send(ent->Dimensions());
SW.Send(ent->Dimensions());
// --- own field : name ---
// --- own field : name ---
SW.Send(ent->Name());
SW.Send(ent->Name());
// --- own field : conversionFactor ---
// --- own field : conversionFactor ---
SW.Send(ent->ConversionFactor());
SW.Send(ent->ConversionFactor());
}
void RWStepBasic_RWConversionBasedUnit::Share(const Handle(StepBasic_ConversionBasedUnit)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());
iter.GetOneItem(ent->ConversionFactor());
}

View File

@@ -19,7 +19,6 @@
#include <RWStepBasic_RWConversionBasedUnitAndAreaUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndAreaUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -28,9 +27,9 @@ RWStepBasic_RWConversionBasedUnitAndAreaUnit::RWStepBasic_RWConversionBasedUnitA
}
void RWStepBasic_RWConversionBasedUnitAndAreaUnit::ReadStep(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndAreaUnit)& ent) const
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndAreaUnit)& ent) const
{
Standard_Integer num = num0;
//data->NamedForComplex("AREA_UNIT",num0,num,ach);
@@ -43,15 +42,15 @@ void RWStepBasic_RWConversionBasedUnitAndAreaUnit::ReadStep(const Handle(StepDat
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
Handle(StepBasic_DimensionalExponents) aDimensions;
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName, aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndAreaUnit::WriteStep(StepData_StepWriter& SW,

View File

@@ -17,96 +17,95 @@
#include <StepBasic_ConversionBasedUnitAndLengthUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_LengthUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
RWStepBasic_RWConversionBasedUnitAndLengthUnit::RWStepBasic_RWConversionBasedUnitAndLengthUnit () {}
void RWStepBasic_RWConversionBasedUnitAndLengthUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndLengthUnit)& ent) const
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndLengthUnit)& ent) const
{
Standard_Integer num = num0;
Standard_Integer num = num0;
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
// --- field : name ---
// --- field : name ---
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of plex component LengthUnit ---
// --- Instance of plex component LengthUnit ---
if (!data->CheckNbParams(num,0,ach,"length_unit")) return;
if (!data->CheckNbParams(num,0,ach,"length_unit")) return;
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
//--- Initialisation of the red entity ---
//--- Initialisation of the red entity ---
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName,aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndLengthUnit::WriteStep
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndLengthUnit)& ent) const
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndLengthUnit)& ent) const
{
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->ConversionFactor());
SW.Send(ent->ConversionFactor());
// --- Instance of plex component LengthUnit ---
// --- Instance of plex component LengthUnit ---
SW.StartEntity("LENGTH_UNIT");
SW.StartEntity("LENGTH_UNIT");
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.Send(ent->Dimensions());
SW.Send(ent->Dimensions());
}
void RWStepBasic_RWConversionBasedUnitAndLengthUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndLengthUnit)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());
iter.GetOneItem(ent->ConversionFactor());
}

View File

@@ -17,7 +17,6 @@
#include <StepBasic_ConversionBasedUnitAndMassUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MassUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -36,10 +35,10 @@ RWStepBasic_RWConversionBasedUnitAndMassUnit::RWStepBasic_RWConversionBasedUnitA
//=======================================================================
void RWStepBasic_RWConversionBasedUnitAndMassUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndMassUnit)& ent) const
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndMassUnit)& ent) const
{
Standard_Integer num = num0;
@@ -51,9 +50,9 @@ void RWStepBasic_RWConversionBasedUnitAndMassUnit::ReadStep
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
@@ -70,7 +69,7 @@ void RWStepBasic_RWConversionBasedUnitAndMassUnit::ReadStep
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
//--- Initialisation of the red entity ---
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName, aConversionFactor);
}

View File

@@ -17,7 +17,6 @@
#include <RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndPlaneAngleUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_PlaneAngleUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -25,71 +24,72 @@
RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit () {}
void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent) const
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent) const
{
// sln 09.10.2001. BUC61003. Correction of looking for items of complex entity in case of them do not saticfy to alphabetical order
// CONVERSION_BASED_UNIT
Standard_Integer num = 0;//num0;
data->NamedForComplex("CONVERSION_BASED_UNIT", "CNBSUN",num0,num,ach);
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
Handle(TCollection_HAsciiString) aName;
data->ReadString (num,1,"name",ach,aName);
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
// NAMED_UNIT
//num = 0; //gka TRJ9 c2-id-214.stp
data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
Handle(StepBasic_DimensionalExponents) aDimensions;
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
Standard_Integer num = 0;//num0;
data->NamedForComplex("CONVERSION_BASED_UNIT", "CNBSUN",num0,num,ach);
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
Handle(TCollection_HAsciiString) aName;
data->ReadString (num,1,"name",ach,aName);
// PLANE_ANGLE_UNIT
//num = 0; //gka
data->NamedForComplex("PLANE_ANGLE_UNIT", "PLANUN",num0,num,ach);
if (!data->CheckNbParams(num,0,ach,"plane_angle_unit")) return;
ent->Init(aDimensions,aName,aConversionFactor);
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
// NAMED_UNIT
//num = 0; //gka TRJ9 c2-id-214.stp
data->NamedForComplex("NAMED_UNIT", "NMDUNT",num0,num,ach);
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
Handle(StepBasic_DimensionalExponents) aDimensions;
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
// PLANE_ANGLE_UNIT
//num = 0; //gka
data->NamedForComplex("PLANE_ANGLE_UNIT", "PLANUN",num0,num,ach);
if (!data->CheckNbParams(num,0,ach,"plane_angle_unit")) return;
ent->Init(aDimensions,aName,aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::WriteStep
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent) const
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent) const
{
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->ConversionFactor());
SW.Send(ent->ConversionFactor());
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.Send(ent->Dimensions());
SW.Send(ent->Dimensions());
// --- Instance of plex component PlaneAngleUnit ---
// --- Instance of plex component PlaneAngleUnit ---
SW.StartEntity("PLANE_ANGLE_UNIT");
SW.StartEntity("PLANE_ANGLE_UNIT");
}
void RWStepBasic_RWConversionBasedUnitAndPlaneAngleUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndPlaneAngleUnit)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());
iter.GetOneItem(ent->ConversionFactor());
}

View File

@@ -16,7 +16,6 @@
#include <RWStepBasic_RWConversionBasedUnitAndRatioUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndRatioUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_RatioUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -24,89 +23,89 @@
RWStepBasic_RWConversionBasedUnitAndRatioUnit::RWStepBasic_RWConversionBasedUnitAndRatioUnit () {}
void RWStepBasic_RWConversionBasedUnitAndRatioUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndRatioUnit)& ent) const
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndRatioUnit)& ent) const
{
Standard_Integer num = num0;
Standard_Integer num = num0;
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
// --- field : name ---
// --- field : name ---
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity(num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
// --- field : dimensions ---
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of plex component RatioUnit ---
// --- Instance of plex component RatioUnit ---
if (!data->CheckNbParams(num,0,ach,"ratio_unit")) return;
if (!data->CheckNbParams(num,0,ach,"ratio_unit")) return;
//--- Initialisation of the red entity ---
//--- Initialisation of the red entity ---
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName, aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndRatioUnit::WriteStep
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndRatioUnit)& ent) const
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndRatioUnit)& ent) const
{
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->ConversionFactor());
SW.Send(ent->ConversionFactor());
// --- Instance of plex component RatioUnit ---
// --- Instance of plex component RatioUnit ---
SW.StartEntity("RATIO_UNIT");
SW.StartEntity("RATIO_UNIT");
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.Send(ent->Dimensions());
SW.Send(ent->Dimensions());
}
void RWStepBasic_RWConversionBasedUnitAndRatioUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndRatioUnit)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());
iter.GetOneItem(ent->ConversionFactor());
}

View File

@@ -16,7 +16,6 @@
#include <RWStepBasic_RWConversionBasedUnitAndSolidAngleUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndSolidAngleUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_SolidAngleUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -24,89 +23,89 @@
RWStepBasic_RWConversionBasedUnitAndSolidAngleUnit::RWStepBasic_RWConversionBasedUnitAndSolidAngleUnit () {}
void RWStepBasic_RWConversionBasedUnitAndSolidAngleUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndSolidAngleUnit)& ent) const
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndSolidAngleUnit)& ent) const
{
Standard_Integer num = num0;
Standard_Integer num = num0;
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
// --- field : name ---
// --- field : name ---
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of plex component SolidAngleUnit ---
// --- Instance of plex component SolidAngleUnit ---
if (!data->CheckNbParams(num,0,ach,"solid_angle_unit")) return;
if (!data->CheckNbParams(num,0,ach,"solid_angle_unit")) return;
//--- Initialisation of the red entity ---
//--- Initialisation of the red entity ---
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName,aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndSolidAngleUnit::WriteStep
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndSolidAngleUnit)& ent) const
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndSolidAngleUnit)& ent) const
{
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->ConversionFactor());
SW.Send(ent->ConversionFactor());
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.Send(ent->Dimensions());
SW.Send(ent->Dimensions());
// --- Instance of plex component SolidAngleUnit ---
// --- Instance of plex component SolidAngleUnit ---
SW.StartEntity("SOLID_ANGLE_UNIT");
SW.StartEntity("SOLID_ANGLE_UNIT");
}
void RWStepBasic_RWConversionBasedUnitAndSolidAngleUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndSolidAngleUnit)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());
iter.GetOneItem(ent->ConversionFactor());
}

View File

@@ -16,7 +16,6 @@
#include <RWStepBasic_RWConversionBasedUnitAndTimeUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndTimeUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepBasic_TimeUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -24,89 +23,88 @@
RWStepBasic_RWConversionBasedUnitAndTimeUnit::RWStepBasic_RWConversionBasedUnitAndTimeUnit () {}
void RWStepBasic_RWConversionBasedUnitAndTimeUnit::ReadStep
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent) const
(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent) const
{
Standard_Integer num = num0;
Standard_Integer num = num0;
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
if (!data->CheckNbParams(num,2,ach,"conversion_based_unit")) return;
// --- field : name ---
// --- field : name ---
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
Handle(TCollection_HAsciiString) aName;
//szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
//szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
// --- field : dimensions ---
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
Handle(StepBasic_DimensionalExponents) aDimensions;
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
data->ReadEntity(num, 1,"dimensions", ach, STANDARD_TYPE(StepBasic_DimensionalExponents), aDimensions);
num = data->NextForComplex(num);
num = data->NextForComplex(num);
// --- Instance of plex component TimeUnit ---
// --- Instance of plex component TimeUnit ---
if (!data->CheckNbParams(num,0,ach,"time_unit")) return;
if (!data->CheckNbParams(num,0,ach,"time_unit")) return;
//--- Initialisation of the red entity ---
//--- Initialisation of the red entity ---
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName, aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndTimeUnit::WriteStep
(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent) const
void RWStepBasic_RWConversionBasedUnitAndTimeUnit::WriteStep(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent) const
{
// --- Instance of plex component ConversionBasedUnit ---
// --- Instance of plex component ConversionBasedUnit ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.StartEntity("CONVERSION_BASED_UNIT");
// --- field : name ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->Name());
// --- field : conversionFactor ---
SW.Send(ent->ConversionFactor());
SW.Send(ent->ConversionFactor());
// --- Instance of plex component TimeUnit ---
// --- Instance of plex component TimeUnit ---
SW.StartEntity("TIME_UNIT");
SW.StartEntity("TIME_UNIT");
// --- Instance of common supertype NamedUnit ---
// --- Instance of common supertype NamedUnit ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.StartEntity("NAMED_UNIT");
// --- field : dimensions ---
SW.Send(ent->Dimensions());
SW.Send(ent->Dimensions());
}
void RWStepBasic_RWConversionBasedUnitAndTimeUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndTimeUnit)& ent, Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());
iter.GetOneItem(ent->ConversionFactor());
}

View File

@@ -19,7 +19,6 @@
#include <RWStepBasic_RWConversionBasedUnitAndVolumeUnit.hxx>
#include <StepBasic_ConversionBasedUnitAndVolumeUnit.hxx>
#include <StepBasic_DimensionalExponents.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
@@ -28,9 +27,9 @@ RWStepBasic_RWConversionBasedUnitAndVolumeUnit::RWStepBasic_RWConversionBasedUni
}
void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::ReadStep(const Handle(StepData_StepReaderData)& data,
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const
const Standard_Integer num0,
Handle(Interface_Check)& ach,
const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const
{
Standard_Integer num = num0;
// --- Instance of plex component ConversionBasedUnit ---
@@ -39,8 +38,8 @@ void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::ReadStep(const Handle(StepD
data->ReadString (num,1,"name",ach,aName);
// --- field : conversionFactor ---
Handle(StepBasic_MeasureWithUnit) aConversionFactor;
data->ReadEntity(num, 2,"conversion_factor", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aConversionFactor);
Handle(Standard_Transient) aConversionFactor;
data->ReadEntity (num, 2, "conversion_factor", ach, STANDARD_TYPE(Standard_Transient), aConversionFactor);
num = data->NextForComplex(num);
if (!data->CheckNbParams(num,1,ach,"named_unit")) return;
@@ -50,11 +49,11 @@ void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::ReadStep(const Handle(StepD
data->NamedForComplex("VOLUME_UNIT","VLMUNT",num0,num,ach);
if (!data->CheckNbParams(num,0,ach,"volume_unit")) return;
ent->Init(aDimensions,aName,aConversionFactor);
ent->Init(aDimensions,aName, aConversionFactor);
}
void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::WriteStep(StepData_StepWriter& SW,
const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const
const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent) const
{
SW.StartEntity("CONVERSION_BASED_UNIT");
SW.Send(ent->Name());
@@ -65,7 +64,7 @@ void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::WriteStep(StepData_StepWrit
}
void RWStepBasic_RWConversionBasedUnitAndVolumeUnit::Share(const Handle(StepBasic_ConversionBasedUnitAndVolumeUnit)& ent,
Interface_EntityIterator& iter) const
Interface_EntityIterator& iter) const
{
iter.GetOneItem(ent->Dimensions());
iter.GetOneItem(ent->ConversionFactor());

View File

@@ -18,7 +18,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWAngularityTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
@@ -54,8 +53,8 @@ void RWStepDimTol_RWAngularityTolerance::ReadStep (const Handle(StepData_StepRea
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -78,7 +77,7 @@ void RWStepDimTol_RWAngularityTolerance::ReadStep (const Handle(StepData_StepRea
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect,
aGeometricToleranceWithDatumReference_DatumSystem);
}

View File

@@ -18,7 +18,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWCircularRunoutTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_CircularRunoutTolerance.hxx>
@@ -54,8 +53,8 @@ void RWStepDimTol_RWCircularRunoutTolerance::ReadStep (const Handle(StepData_Ste
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -78,7 +77,7 @@ void RWStepDimTol_RWCircularRunoutTolerance::ReadStep (const Handle(StepData_Ste
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect,
aGeometricToleranceWithDatumReference_DatumSystem);
}

View File

@@ -18,7 +18,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWCoaxialityTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_CoaxialityTolerance.hxx>
@@ -54,8 +53,8 @@ void RWStepDimTol_RWCoaxialityTolerance::ReadStep (const Handle(StepData_StepRea
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -78,7 +77,7 @@ void RWStepDimTol_RWCoaxialityTolerance::ReadStep (const Handle(StepData_StepRea
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect,
aGeometricToleranceWithDatumReference_DatumSystem);
}

View File

@@ -18,7 +18,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWConcentricityTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_ConcentricityTolerance.hxx>
@@ -54,8 +53,8 @@ void RWStepDimTol_RWConcentricityTolerance::ReadStep (const Handle(StepData_Step
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -78,7 +77,7 @@ void RWStepDimTol_RWConcentricityTolerance::ReadStep (const Handle(StepData_Step
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect,
aGeometricToleranceWithDatumReference_DatumSystem);
}

View File

@@ -17,7 +17,6 @@
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWCylindricityTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_CylindricityTolerance.hxx>
@@ -52,8 +51,8 @@ void RWStepDimTol_RWCylindricityTolerance::ReadStep (const Handle(StepData_StepR
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -61,7 +60,7 @@ void RWStepDimTol_RWCylindricityTolerance::ReadStep (const Handle(StepData_StepR
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect);
}

View File

@@ -17,7 +17,6 @@
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWFlatnessTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_FlatnessTolerance.hxx>
@@ -35,7 +34,6 @@ RWStepDimTol_RWFlatnessTolerance::RWStepDimTol_RWFlatnessTolerance ()
//function : ReadStep
//purpose :
//=======================================================================
void RWStepDimTol_RWFlatnessTolerance::ReadStep (const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
@@ -52,8 +50,8 @@ void RWStepDimTol_RWFlatnessTolerance::ReadStep (const Handle(StepData_StepReade
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -61,7 +59,7 @@ void RWStepDimTol_RWFlatnessTolerance::ReadStep (const Handle(StepData_StepReade
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect);
}

View File

@@ -17,7 +17,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeoTolAndGeoTolWthDatRef.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
@@ -51,8 +50,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRef::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -18,7 +18,6 @@
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
@@ -53,8 +52,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -17,7 +17,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMod.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
@@ -52,8 +51,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndGeoTolWthMod::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -15,7 +15,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
@@ -50,8 +49,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -51,8 +51,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndUneqDisGeoTol::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -18,7 +18,6 @@
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeoTolAndGeoTolWthMaxTol.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthMaxTol.hxx>
@@ -51,8 +50,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthMaxTol::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -17,7 +17,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeoTolAndGeoTolWthMod.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeoTolAndGeoTolWthMod.hxx>
@@ -50,8 +49,10 @@ void RWStepDimTol_RWGeoTolAndGeoTolWthMod::ReadStep
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -17,7 +17,6 @@
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeometricTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricTolerance.hxx>
@@ -52,8 +51,8 @@ void RWStepDimTol_RWGeometricTolerance::ReadStep (const Handle(StepData_StepRead
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -18,7 +18,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWGeometricToleranceWithDatumReference.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDatumReference.hxx>
@@ -53,8 +52,8 @@ void RWStepDimTol_RWGeometricToleranceWithDatumReference::ReadStep (const Handle
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -77,7 +76,7 @@ void RWStepDimTol_RWGeometricToleranceWithDatumReference::ReadStep (const Handle
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect,
aDatumSystem);
}

View File

@@ -17,7 +17,6 @@
#include <Interface_EntityIterator.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDefinedAreaUnit.hxx>
@@ -53,8 +52,8 @@ void RWStepDimTol_RWGeometricToleranceWithDefinedAreaUnit::
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -17,7 +17,6 @@
#include <Interface_EntityIterator.hxx>
#include <StepBasic_LengthMeasureWithUnit.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithDefinedUnit.hxx>
@@ -52,8 +51,8 @@ void RWStepDimTol_RWGeometricToleranceWithDefinedUnit::ReadStep (const Handle(St
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -21,7 +21,6 @@
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithMaximumTolerance.hxx>
#include <StepDimTol_HArray1OfGeometricToleranceModifier.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
//=======================================================================
//function : RWStepDimTol_RWGeometricTolerance
@@ -54,8 +53,8 @@ void RWStepDimTol_RWGeometricToleranceWithMaximumTolerance::
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -17,7 +17,6 @@
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_GeometricToleranceWithModifiers.hxx>
@@ -54,8 +53,8 @@ void RWStepDimTol_RWGeometricToleranceWithModifiers::
Handle(TCollection_HAsciiString) aDescription;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aDescription);
Handle(StepBasic_MeasureWithUnit) aMagnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aTolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aTolerancedShapeAspect);

View File

@@ -17,7 +17,6 @@
#include <Interface_EntityIterator.hxx>
#include <RWStepDimTol_RWLineProfileTolerance.hxx>
#include <StepBasic_MeasureWithUnit.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepDimTol_LineProfileTolerance.hxx>
@@ -51,8 +50,8 @@ void RWStepDimTol_RWLineProfileTolerance::ReadStep (const Handle(StepData_StepRe
Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
Handle(Standard_Transient) aMagnitude;
data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(Standard_Transient), aMagnitude);
StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
@@ -60,7 +59,7 @@ void RWStepDimTol_RWLineProfileTolerance::ReadStep (const Handle(StepData_StepRe
// Initialize entity
ent->Init(aGeometricTolerance_Name,
aGeometricTolerance_Description,
aGeometricTolerance_Magnitude,
aMagnitude,
aGeometricTolerance_TolerancedShapeAspect);
}

Some files were not shown because too many files have changed in this diff Show More