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

0029074: Visualization, TKOpenGl - support Geometry Shader definition

Graphic3d_TypeOfShaderObject enumeration has been extended by Geometry shader object type.
OpenGl_ShaderProgram::Initialize() processes new shader object types when supported by OpenGL version.
Declarations.glsl has been fixed so that occFragColor is defined only for
Fragment Shader object only (by handling new FRAGMENT_SHADER macros).

Improved documentation of Graphic3d_ArrayOfPrimitives class.

vshader Draw Harness command has been extended to support definition
of Shader Object types other than Vertex and Fragment shader.
This commit is contained in:
kgv
2017-09-01 17:45:49 +03:00
committed by bugmaster
parent 3ed88facdb
commit 8e0a2b19ab
60 changed files with 1190 additions and 1210 deletions

View File

@@ -1,22 +1,13 @@
Graphic3d_ArrayOfPoints.cxx
Graphic3d_ArrayOfPoints.hxx
Graphic3d_ArrayOfPolygons.cxx
Graphic3d_ArrayOfPolygons.hxx
Graphic3d_ArrayOfPolylines.cxx
Graphic3d_ArrayOfPolylines.hxx
Graphic3d_ArrayOfPrimitives.cxx
Graphic3d_ArrayOfPrimitives.hxx
Graphic3d_ArrayOfQuadrangles.cxx
Graphic3d_ArrayOfQuadrangles.hxx
Graphic3d_ArrayOfQuadrangleStrips.cxx
Graphic3d_ArrayOfQuadrangleStrips.hxx
Graphic3d_ArrayOfSegments.cxx
Graphic3d_ArrayOfSegments.hxx
Graphic3d_ArrayOfTriangleFans.cxx
Graphic3d_ArrayOfTriangleFans.hxx
Graphic3d_ArrayOfTriangles.cxx
Graphic3d_ArrayOfTriangles.hxx
Graphic3d_ArrayOfTriangleStrips.cxx
Graphic3d_ArrayOfTriangleStrips.hxx
Graphic3d_AspectFillArea3d.cxx
Graphic3d_AspectFillArea3d.hxx

View File

@@ -1,25 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPoints,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfPoints::Graphic3d_ArrayOfPoints (const Standard_Integer theMaxVertexs,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasVNormals)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POINTS, theMaxVertexs, 0, 0, theHasVNormals, theHasVColors, Standard_False, Standard_False)
{}

View File

@@ -15,52 +15,25 @@
#ifndef _Graphic3d_ArrayOfPoints_HeaderFile
#define _Graphic3d_ArrayOfPoints_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfPoints;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPoints, Graphic3d_ArrayOfPrimitives)
//! Contains points array definition
//! Contains points array definition.
class Graphic3d_ArrayOfPoints : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPoints, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of points,
//! a single pixel point is drawn at each vertex.
//! Creates an array of points, a single pixel point is drawn at each vertex.
//! The array must be filled using the AddVertex(Point) method.
//! When <hasVColors> is TRUE , you must use only AddVertex(Point,Color) method.
//! When <hasVNormals> is TRUE , you must use only AddVertex(Point,Normal) method.
Standard_EXPORT Graphic3d_ArrayOfPoints(const Standard_Integer maxVertexs, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasVNormals = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPoints,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! @param theHasVColors when TRUE, AddVertex(Point,Color) should be used for specifying vertex color
//! @param theHasVNormals when TRUE, AddVertex(Point,Normal) should be used for specifying vertex normal
Graphic3d_ArrayOfPoints (const Standard_Integer theMaxVertexs,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasVNormals = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POINTS, theMaxVertexs, 0, 0, theHasVNormals, theHasVColors, Standard_False, Standard_False) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPoints, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfPoints_HeaderFile

View File

@@ -1,29 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfPolygons.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolygons,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfPolygons::Graphic3d_ArrayOfPolygons (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxBounds,
const Standard_Integer theMaxEdges,
const Standard_Boolean theHasVNormals,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasFColors,
const Standard_Boolean theHasVTexels)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POLYGONS, theMaxVertexs, theMaxBounds, theMaxEdges, theHasVNormals, theHasVColors, theHasFColors, theHasVTexels)
{}

View File

@@ -15,130 +15,91 @@
#ifndef _Graphic3d_ArrayOfPolygons_HeaderFile
#define _Graphic3d_ArrayOfPolygons_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfPolygons;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
//! Contains polygons array definition
//! Contains polygons array definition.
//! WARNING! Polygon primitives might be unsupported by graphics library.
//! Triangulation should be used instead of quads for better compatibility.
class Graphic3d_ArrayOfPolygons : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of polygons,
//! a polygon can be filled as:
//! 1) creating a single polygon defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolygons(7)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 2) creating separate polygons defined with a predefined
//! number of bounds and the number of vertex per bound.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolygons(7,2)
//! myArray->AddBound(4)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddBound(3)
//! myArray->AddVertex(x5,y5,z5)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 3) creating a single indexed polygon defined with his vertex
//! ans edges.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolygons(4,0,6)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(4)
//! 4) creating separate polygons defined with a predefined
//! number of bounds and the number of edges per bound.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolygons(6,4,14)
//! myArray->AddBound(3)
//! myArray->AddVertex(x1,y1,z1)
//! myArray->AddVertex(x2,y2,z2)
//! myArray->AddVertex(x3,y3,z3)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddBound(3)
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddVertex(x5,y5,z5)
//! myArray->AddVertex(x6,y6,z6)
//! myArray->AddEdge(4)
//! myArray->AddEdge(5)
//! myArray->AddEdge(6)
//! myArray->AddBound(4)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(5)
//! myArray->AddEdge(6)
//! myArray->AddBound(4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(3)
//! myArray->AddEdge(5)
//! myArray->AddEdge(4)
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxBounds> defined the maximun allowed bound number in the array.
//! <maxEdges> defined the maximun allowed edge number in the array.
//! Warning:
//! When <hasVNormals> is TRUE , you must use one of
//! AddVertex(Point,Normal)
//! or AddVertex(Point,Normal,Color)
//! or AddVertex(Point,Normal,Texel) methods.
//! When <hasVColors> is TRUE , you must use one of
//! AddVertex(Point,Color)
//! or AddVertex(Point,Normal,Color) methods.
//! When <hasTexels> is TRUE , you must use one of
//! AddVertex(Point,Texel)
//! or AddVertex(Point,Normal,Texel) methods.
//! When <hasBColors> is TRUE , <maxBounds> must be > 0 and
//! you must use the
//! AddBound(number,Color) method.
//! Warning:
//! the user is responsible about the orientation of the polygon
//! depending of the order of the created vertex or edges and this
//! orientation must be coherent with the vertex normal optionnaly
//! given at each vertex (See the Orientate() methods).
Standard_EXPORT Graphic3d_ArrayOfPolygons(const Standard_Integer maxVertexs, const Standard_Integer maxBounds = 0, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasBColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolygons,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of polygons, a polygon can be filled as:
//! 1) Creating a single polygon defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolygons (7);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 2) Creating separate polygons defined with a predefined number of bounds and the number of vertex per bound, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolygons (7, 2);
//! myArray->AddBound (4);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddBound (3);
//! myArray->AddVertex (x5, y5, z5);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 3) Creating a single indexed polygon defined with his vertex ans edges, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolygons (4, 0, 6);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (4);
//! @endcode
//! 4) Creating separate polygons defined with a predefined number of bounds and the number of edges per bound, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolygons (6, 4, 14);
//! myArray->AddBound (3);
//! myArray->AddVertex (x1, y1, z1);
//! myArray->AddVertex (x2, y2, z2);
//! myArray->AddVertex (x3, y3, z3);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddBound (3);
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddVertex (x5, y5, z5);
//! myArray->AddVertex (x6, y6, z6);
//! myArray->AddEdge (4);
//! myArray->AddEdge (5);
//! myArray->AddEdge (6);
//! myArray->AddBound (4);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (5);
//! myArray->AddEdge (6);
//! myArray->AddBound (4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (3);
//! myArray->AddEdge (5);
//! myArray->AddEdge (4);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxBounds defines the maximum allowed bound number in the array
//! @param theMaxEdges defines the maximum allowed edge number in the array
Graphic3d_ArrayOfPolygons (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxBounds = 0,
const Standard_Integer theMaxEdges = 0,
const Standard_Boolean theHasVNormals = Standard_False,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasBColors = Standard_False,
const Standard_Boolean theHasVTexels = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POLYGONS, theMaxVertexs, theMaxBounds, theMaxEdges, theHasVNormals, theHasVColors, theHasBColors, theHasVTexels) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfPolygons_HeaderFile

View File

@@ -1,27 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolylines,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfPolylines::Graphic3d_ArrayOfPolylines (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxBounds,
const Standard_Integer theMaxEdges,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasFColors)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POLYLINES, theMaxVertexs, theMaxBounds, theMaxEdges, Standard_False, theHasVColors, theHasFColors, Standard_False)
{}

View File

@@ -15,119 +15,89 @@
#ifndef _Graphic3d_ArrayOfPolylines_HeaderFile
#define _Graphic3d_ArrayOfPolylines_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfPolylines;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
//! Contains polylines array definition
//! Contains polylines array definition.
class Graphic3d_ArrayOfPolylines : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of polylines,
//! a polyline can be filled as:
//! 1) creating a single polyline defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolylines(7)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 2) creating separate polylines defined with a predefined
//! number of bounds and the number of vertex per bound.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolylines(7,2)
//! myArray->AddBound(4)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddBound(3)
//! myArray->AddVertex(x5,y5,z5)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 3) creating a single indexed polyline defined with his vertex
//! ans edges.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolylines(4,0,6)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(4)
//! 4) creating separate polylines defined with a predefined
//! number of bounds and the number of edges per bound.
//! i.e:
//! myArray = Graphic3d_ArrayOfPolylines(6,4,14)
//! myArray->AddBound(3)
//! myArray->AddVertex(x1,y1,z1)
//! myArray->AddVertex(x2,y2,z2)
//! myArray->AddVertex(x3,y3,z3)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddBound(3)
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddVertex(x5,y5,z5)
//! myArray->AddVertex(x6,y6,z6)
//! myArray->AddEdge(4)
//! myArray->AddEdge(5)
//! myArray->AddEdge(6)
//! myArray->AddBound(4)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(5)
//! myArray->AddEdge(6)
//! myArray->AddBound(4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(3)
//! myArray->AddEdge(5)
//! myArray->AddEdge(4)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxBounds> defined the maximun allowed bound number in the array.
//! <maxEdges> defined the maximun allowed edge number in the array.
//! Warning:
//! When <hasVColors> is TRUE , you must use one of
//! AddVertex(Point,Color)
//! or AddVertex(Point,Normal,Color) methods.
//! When <hasBColors> is TRUE , <maxBounds> must be > 0 and
//! you must use the
//! AddBound(number,Color) method.
Standard_EXPORT Graphic3d_ArrayOfPolylines(const Standard_Integer maxVertexs, const Standard_Integer maxBounds = 0, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasBColors = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolylines,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of polylines, a polyline can be filled as:
//! 1) Creating a single polyline defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolylines (7);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 2) Creating separate polylines defined with a predefined number of bounds and the number of vertex per bound, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolylines (7, 2);
//! myArray->AddBound (4);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddBound (3);
//! myArray->AddVertex (x5, y5, z5);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 3) Creating a single indexed polyline defined with his vertex and edges, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolylines (4, 0, 6);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (4);
//! @endcode
//! 4) creating separate polylines defined with a predefined number of bounds and the number of edges per bound, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfPolylines (6, 4, 14);
//! myArray->AddBound (3);
//! myArray->AddVertex (x1, y1, z1);
//! myArray->AddVertex (x2, y2, z2);
//! myArray->AddVertex (x3, y3, z3);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddBound (3);
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddVertex (x5, y5, z5);
//! myArray->AddVertex (x6, y6, z6);
//! myArray->AddEdge (4);
//! myArray->AddEdge (5);
//! myArray->AddEdge (6);
//! myArray->AddBound (4);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (5);
//! myArray->AddEdge (6);
//! myArray->AddBound (4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (3);
//! myArray->AddEdge (5);
//! myArray->AddEdge (4);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxBounds defines the maximum allowed bound number in the array
//! @param theMaxEdges defines the maximum allowed edge number in the array
//! @param theHasVColors when TRUE AddVertex(Point,Color) or AddVertex(Point,Normal,Color) should be used to specify per-vertex color values
//! @param theHasBColors when TRUE AddBound(number,Color) should be used to specify sub-group color
Graphic3d_ArrayOfPolylines (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxBounds = 0,
const Standard_Integer theMaxEdges = 0,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasBColors = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POLYLINES, theMaxVertexs, theMaxBounds, theMaxEdges, Standard_False, theHasVColors, theHasBColors, Standard_False) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfPolylines_HeaderFile

View File

@@ -14,6 +14,16 @@
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_ArrayOfTriangleStrips.hxx>
#include <Graphic3d_ArrayOfTriangleFans.hxx>
#include <Graphic3d_ArrayOfQuadrangles.hxx>
#include <Graphic3d_ArrayOfQuadrangleStrips.hxx>
#include <Graphic3d_ArrayOfPolygons.hxx>
#include <NCollection_AlignedAllocator.hxx>
#include <TCollection_AsciiString.hxx>
@@ -22,6 +32,16 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPrimitives, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPoints, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfSegments, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangles, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleStrips, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleFans, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
// =======================================================================
// function : Graphic3d_ArrayOfPrimitives
// purpose :
@@ -246,14 +266,18 @@ Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
switch (myType)
{
case Graphic3d_TOPA_POINTS: return "ArrayOfPoints";
case Graphic3d_TOPA_POLYLINES: return "ArrayOfPolylines";
case Graphic3d_TOPA_SEGMENTS: return "ArrayOfSegments";
case Graphic3d_TOPA_POLYGONS: return "ArrayOfPolygons";
case Graphic3d_TOPA_POLYLINES: return "ArrayOfPolylines";
case Graphic3d_TOPA_TRIANGLES: return "ArrayOfTriangles";
case Graphic3d_TOPA_QUADRANGLES: return "ArrayOfQuadrangles";
case Graphic3d_TOPA_TRIANGLESTRIPS: return "ArrayOfTriangleStrips";
case Graphic3d_TOPA_QUADRANGLESTRIPS: return "ArrayOfQuadrangleStrips";
case Graphic3d_TOPA_TRIANGLEFANS: return "ArrayOfTriangleFans";
case Graphic3d_TOPA_LINES_ADJACENCY: return "ArrayOfLinesAdjacency";
case Graphic3d_TOPA_LINE_STRIP_ADJACENCY: return "ArrayOfLineStripAdjacency";
case Graphic3d_TOPA_TRIANGLES_ADJACENCY: return "ArrayOfTrianglesAdjacency";
case Graphic3d_TOPA_TRIANGLE_STRIP_ADJACENCY: return "ArrayOfTriangleStripAdjacency";
case Graphic3d_TOPA_QUADRANGLES: return "ArrayOfQuadrangles";
case Graphic3d_TOPA_QUADRANGLESTRIPS: return "ArrayOfQuadrangleStrips";
case Graphic3d_TOPA_POLYGONS: return "ArrayOfPolygons";
case Graphic3d_TOPA_UNDEFINED: return "UndefinedArray";
}
return "UndefinedArray";
@@ -293,6 +317,18 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
case Graphic3d_TOPA_TRIANGLEFANS: return !myBounds.IsNull()
? myAttribs->NbElements - 2 * myBounds->NbBounds
: myAttribs->NbElements - 2;
case Graphic3d_TOPA_LINES_ADJACENCY: return myIndices.IsNull() || myIndices->NbElements < 1
? myAttribs->NbElements / 4
: myIndices->NbElements / 4;
case Graphic3d_TOPA_LINE_STRIP_ADJACENCY: return !myBounds.IsNull()
? myAttribs->NbElements - 4 * myBounds->NbBounds
: myAttribs->NbElements - 4;
case Graphic3d_TOPA_TRIANGLES_ADJACENCY: return myIndices.IsNull() || myIndices->NbElements < 1
? myAttribs->NbElements / 6
: myIndices->NbElements / 6;
case Graphic3d_TOPA_TRIANGLE_STRIP_ADJACENCY: return !myBounds.IsNull()
? myAttribs->NbElements - 4 * myBounds->NbBounds
: myAttribs->NbElements - 4;
case Graphic3d_TOPA_UNDEFINED: return -1;
}
return -1;
@@ -407,6 +443,20 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
return Standard_False;
}
break;
case Graphic3d_TOPA_LINES_ADJACENCY:
case Graphic3d_TOPA_LINE_STRIP_ADJACENCY:
if (nvertexs < 4)
{
return Standard_False;
}
break;
case Graphic3d_TOPA_TRIANGLES_ADJACENCY:
case Graphic3d_TOPA_TRIANGLE_STRIP_ADJACENCY:
if (nvertexs < 6)
{
return Standard_False;
}
break;
case Graphic3d_TOPA_UNDEFINED:
default:
return Standard_False;

View File

@@ -24,28 +24,41 @@
#include <Standard_OutOfRange.hxx>
#include <Quantity_Color.hxx>
class Quantity_Color;
class Graphic3d_ArrayOfPrimitives;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPrimitives, Standard_Transient)
//! This class furnish services to defined and fill an
//! array of primitives compatible with the use of
//! the OPENGl glDrawArrays() or glDrawElements() functions.
//! NOTE that the main goal of this kind of primitive
//! is to avoid multiple copies of datas between
//! each layer of the software.
//! So the array datas exist only one time and the use
//! of SetXxxxxx() methods enable to change dynamically
//! the aspect of this primitive.
//! This class furnish services to defined and fill an array of primitives
//! which can be passed directly to graphics rendering API.
//!
//! Advantages are :
//! 1) Decrease strongly the loading time.
//! 2) Decrease strongly the display time using optimized Opengl
//! primitives.
//! 3) Enable to change dynamically the components of the primitive
//! (vertice,normal,color,texture coordinates).
//! 4) Add true triangle and quadrangle strips or fans capabilities.
//! The basic interface consists of the following parts:
//! 1) Specifying primitive type.
//! WARNING! Particular primitive types might be unsupported by specific hardware/graphics API (like quads and polygons).
//! It is always preferred using one of basic types having maximum compatibility:
//! Point, Triangle (or Triangle strip), Segment aka Lines (or Polyline aka Line Strip).
//! Primitive strip types can be used to reduce memory usage as alternative to Indexed arrays.
//! 2) Vertex array.
//! - Specifying the (maximum) number of vertexes within array.
//! - Specifying the vertex attributes, complementary to mandatory vertex Position (normal, color, UV texture coordinates).
//! - Defining vertex values by using various versions of AddVertex() or SetVertex*() methods.
//! 3) Index array (optional).
//! - Specifying the (maximum) number of indexes (edges).
//! - Defining index values by using AddEdge() method; the index value should be within number of defined Vertexes.
//!
//! Indexed array allows sharing vertex data across Primitives and thus reducing memory usage,
//! since index size is much smaller then size of vertex with all its attributes.
//! It is a preferred way for defining primitive array and main alternative to Primitive Strips for optimal memory usage,
//! although it is also possible (but unusual) defining Indexed Primitive Strip.
//! Note that it is NOT possible sharing Vertex Attributes partially (e.g. share Position, but have different Normals);
//! in such cases Vertex should be entirely duplicated with all Attributes.
//! 4) Bounds array (optional).
//! - Specifying the (maximum) number of bounds.
//! - Defining bounds using AddBound() methods.
//!
//! Bounds allow splitting Primitive Array into sub-groups.
//! This is useful only in two cases - for specifying per-group color and for restarting Primitive Strips.
//! WARNING! Bounds within Primitive Array break rendering batches into parts (additional for loops),
//! affecting rendering performance negatively (increasing CPU load).
class Graphic3d_ArrayOfPrimitives : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPrimitives, Standard_Transient)

View File

@@ -1,28 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfQuadrangleStrips.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfQuadrangleStrips::Graphic3d_ArrayOfQuadrangleStrips (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxStrips,
const Standard_Boolean theHasVNormals,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasSColors,
const Standard_Boolean theHasVTexels)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_QUADRANGLESTRIPS, theMaxVertexs, theMaxStrips, 0, theHasVNormals, theHasVColors, theHasSColors, theHasVTexels)
{}

View File

@@ -15,72 +15,49 @@
#ifndef _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile
#define _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfQuadrangleStrips;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
//! Contains quadrangles strip array definition
//! Contains quadrangles strip array definition.
//! WARNING! Quadrangle primitives might be unsupported by graphics library.
//! Triangulation should be used instead of quads for better compatibility.
class Graphic3d_ArrayOfQuadrangleStrips : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of quadrangle strips,
//! a polygon can be filled as:
//! 1) creating a single strip defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfQuadrangleStrips(7)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 2) creating separate strips defined with a predefined
//! number of strips and the number of vertex per strip.
//! i.e:
//! myArray = Graphic3d_ArrayOfQuadrangleStrips(8,2)
//! myArray->AddBound(4)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddBound(4)
//! myArray->AddVertex(x5,y5,z5)
//! ....
//! myArray->AddVertex(x8,y8,z8)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxStrips> defined the maximun allowed strip number in the array.
//! The number of quadrangle really drawn is :
//! VertexNumber()/2-Min(1,BoundNumber())
Standard_EXPORT Graphic3d_ArrayOfQuadrangleStrips(const Standard_Integer maxVertexs, const Standard_Integer maxStrips = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasSColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of quadrangle strips, a polygon can be filled as:
//! 1) Creating a single strip defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfQuadrangleStrips (7);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 2) Creating separate strips defined with a predefined number of strips and the number of vertex per strip, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfQuadrangleStrips (8, 2);
//! myArray->AddBound (4);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddBound (4);
//! myArray->AddVertex (x5, y5, z5);
//! ....
//! myArray->AddVertex (x8, y8, z8);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxStrips defines the maximum allowed strip number in the array
//! The number of quadrangle really drawn is: VertexNumber()/2 - Min(1, BoundNumber()).
Graphic3d_ArrayOfQuadrangleStrips (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxStrips = 0,
const Standard_Boolean theHasVNormals = Standard_False,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasSColors = Standard_False,
const Standard_Boolean theHasVTexels = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_QUADRANGLESTRIPS, theMaxVertexs, theMaxStrips, 0, theHasVNormals, theHasVColors, theHasSColors, theHasVTexels) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile

View File

@@ -1,28 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfQuadrangles.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangles,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfQuadrangles::Graphic3d_ArrayOfQuadrangles (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxEdges,
const Standard_Boolean theHasVNormals,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasVTexels)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_QUADRANGLES, theMaxVertexs, 0, theMaxEdges, theHasVNormals, theHasVColors, Standard_False, theHasVTexels)
{}

View File

@@ -15,90 +15,50 @@
#ifndef _Graphic3d_ArrayOfQuadrangles_HeaderFile
#define _Graphic3d_ArrayOfQuadrangles_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Standard_OutOfRange;
class Graphic3d_ArrayOfQuadrangles;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
//! Contains quatrangles array definition
//! Contains quadrangles array definition.
//! WARNING! Quadrangle primitives might be unsupported by graphics library.
//! Triangulation should be used instead of quads for better compatibility.
class Graphic3d_ArrayOfQuadrangles : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of quadrangles,
//! a quadrangle can be filled as:
//! 1) creating a set of quadrangles defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfQuadrangles(8)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x8,y8,z8)
//! 3) creating a set of indexed quadrangles defined with his vertex
//! ans edges.
//! i.e:
//! myArray = Graphic3d_ArrayOfQuadrangles(6,8)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x6,y6,z6)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(4)
//! myArray->AddEdge(3)
//! myArray->AddEdge(4)
//! myArray->AddEdge(5)
//! myArray->AddEdge(6)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxEdges> defined the maximun allowed edge number in the array.
//! Warning:
//! When <hasVNormals> is TRUE , you must use one of
//! AddVertex(Point,Normal)
//! or AddVertex(Point,Normal,Color)
//! or AddVertex(Point,Normal,Texel) methods.
//! When <hasVColors> is TRUE , you must use one of
//! AddVertex(Point,Color)
//! or AddVertex(Point,Normal,Color) methods.
//! When <hasTexels> is TRUE , you must use one of
//! AddVertex(Point,Texel)
//! or AddVertex(Point,Normal,Texel) methods.
//! Warning:
//! the user is responsible about the orientation of the quadrangle
//! depending of the order of the created vertex or edges and this
//! orientation must be coherent with the vertex normal optionnaly
//! given at each vertex (See the Orientate() methods).
Standard_EXPORT Graphic3d_ArrayOfQuadrangles(const Standard_Integer maxVertexs, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangles,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of quadrangles, a quadrangle can be filled as:
//! 1) Creating a set of quadrangles defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfQuadrangles (8);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x8, y8, z8);
//! @endcode
//! 2) Creating a set of indexed quadrangles defined with his vertex ans edges, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfQuadrangles (6, 8);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x6, y6, z6);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (4);
//! myArray->AddEdge (3);
//! myArray->AddEdge (4);
//! myArray->AddEdge (5);
//! myArray->AddEdge (6);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxEdges defines the maximum allowed edge number in the array (for indexed array)
Graphic3d_ArrayOfQuadrangles (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxEdges = 0,
const Standard_Boolean theHasVNormals = Standard_False,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasVTexels = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_QUADRANGLES, theMaxVertexs, 0, theMaxEdges, theHasVNormals, theHasVColors, Standard_False, theHasVTexels) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfQuadrangles_HeaderFile

View File

@@ -1,25 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfSegments,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfSegments::Graphic3d_ArrayOfSegments (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxEdges,
const Standard_Boolean theHasVColors)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_SEGMENTS, theMaxVertexs, 0, theMaxEdges, Standard_False, theHasVColors, Standard_False, Standard_False)
{}

View File

@@ -15,76 +15,47 @@
#ifndef _Graphic3d_ArrayOfSegments_HeaderFile
#define _Graphic3d_ArrayOfSegments_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfSegments;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfSegments, Graphic3d_ArrayOfPrimitives)
//! Contains segments array definition
//! Contains segments array definition.
class Graphic3d_ArrayOfSegments : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfSegments, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of segments,
//! a segment can be filled as:
//! 1) creating a set of segments defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfSegments(4)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! 2) creating a set of indexed segments defined with his vertex
//! ans edges.
//! i.e:
//! myArray = Graphic3d_ArrayOfSegments(4,0,8)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(4)
//! myArray->AddEdge(2)
//! myArray->AddEdge(4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(3)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxEdges> defined the maximun allowed edge number in the array.
//! Warning:
//! When <hasVColors> is TRUE , you must use only
//! AddVertex(Point,Color) method
Standard_EXPORT Graphic3d_ArrayOfSegments(const Standard_Integer maxVertexs, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVColors = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfSegments,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of segments, a segment can be filled as:
//! 1) Creating a set of segments defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfSegments (4);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! @endcode
//! 2) Creating a set of indexed segments defined with his vertex and edges, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfSegments (4, 0, 8);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (4);
//! myArray->AddEdge (2);
//! myArray->AddEdge (4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (3);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxEdges defines the maximum allowed edge number in the array
//! @param theHasVColors when TRUE, AddVertex(Point,Color) should be used for specifying vertex color
Graphic3d_ArrayOfSegments (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxEdges = 0,
const Standard_Boolean theHasVColors = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_SEGMENTS, theMaxVertexs, 0, theMaxEdges, Standard_False, theHasVColors, Standard_False, Standard_False) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfSegments, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfSegments_HeaderFile

View File

@@ -1,28 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfTriangleFans.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleFans,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfTriangleFans::Graphic3d_ArrayOfTriangleFans (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxFans,
const Standard_Boolean theHasVNormals,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasFColors,
const Standard_Boolean theHasVTexels)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLEFANS, theMaxVertexs, theMaxFans, 0, theHasVNormals, theHasVColors, theHasFColors, theHasVTexels)
{}

View File

@@ -15,72 +15,47 @@
#ifndef _Graphic3d_ArrayOfTriangleFans_HeaderFile
#define _Graphic3d_ArrayOfTriangleFans_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfTriangleFans;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangleFans, Graphic3d_ArrayOfPrimitives)
//! Contains triangles fan array definition
class Graphic3d_ArrayOfTriangleFans : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleFans, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of triangle fans,
//! a polygon can be filled as:
//! 1) creating a single fan defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfTriangleFans(7)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 2) creating separate fans defined with a predefined
//! number of fans and the number of vertex per fan.
//! i.e:
//! myArray = Graphic3d_ArrayOfTriangleFans(8,2)
//! myArray->AddBound(4)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddBound(4)
//! myArray->AddVertex(x5,y5,z5)
//! ....
//! myArray->AddVertex(x8,y8,z8)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxFans> defined the maximun allowed fan number in the array.
//! The number of triangle really drawn is :
//! VertexNumber()-2*Min(1,BoundNumber())
Standard_EXPORT Graphic3d_ArrayOfTriangleFans(const Standard_Integer maxVertexs, const Standard_Integer maxFans = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasFColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleFans,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of triangle fans, a polygon can be filled as:
//! 1) Creating a single fan defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangleFans (7);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 2) creating separate fans defined with a predefined number of fans and the number of vertex per fan, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangleFans (8, 2);
//! myArray->AddBound (4);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddBound (4);
//! myArray->AddVertex (x5, y5, z5);
//! ....
//! myArray->AddVertex (x8, y8, z8);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxFans defines the maximum allowed fan number in the array
//! The number of triangle really drawn is: VertexNumber() - 2 * Min(1, BoundNumber())
Graphic3d_ArrayOfTriangleFans (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxFans = 0,
const Standard_Boolean theHasVNormals = Standard_False,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasBColors = Standard_False,
const Standard_Boolean theHasVTexels = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLEFANS, theMaxVertexs, theMaxFans, 0, theHasVNormals, theHasVColors, theHasBColors, theHasVTexels) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangleFans, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfTriangleFans_HeaderFile

View File

@@ -1,28 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfTriangleStrips.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleStrips,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfTriangleStrips::Graphic3d_ArrayOfTriangleStrips (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxStrips,
const Standard_Boolean theHasVNormals,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasSColors,
const Standard_Boolean theHasVTexels)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLESTRIPS, theMaxVertexs, theMaxStrips, 0, theHasVNormals, theHasVColors, theHasSColors, theHasVTexels)
{}

View File

@@ -15,91 +15,52 @@
#ifndef _Graphic3d_ArrayOfTriangleStrips_HeaderFile
#define _Graphic3d_ArrayOfTriangleStrips_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfTriangleStrips;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangleStrips, Graphic3d_ArrayOfPrimitives)
//! Contains triangles strip array definition
//! Contains triangles strip array definition.
class Graphic3d_ArrayOfTriangleStrips : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleStrips, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of triangle strips,
//! a polygon can be filled as:
//! 1) creating a single strip defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfTriangleStrips(7)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x7,y7,z7)
//! 2) creating separate strips defined with a predefined
//! number of strips and the number of vertex per strip.
//! i.e:
//! myArray = Graphic3d_ArrayOfTriangleStrips(8,2)
//! myArray->AddBound(4)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddBound(4)
//! myArray->AddVertex(x5,y5,z5)
//! ....
//! myArray->AddVertex(x8,y8,z8)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxStrips> defined the maximun allowed strip number in the array.
//! The number of triangle really drawn is :
//! VertexNumber()-2*Min(1,BoundNumber())
//! Warning:
//! When <hasVNormals> is TRUE , you must use one of
//! AddVertex(Point,Normal)
//! or AddVertex(Point,Normal,Color)
//! or AddVertex(Point,Normal,Texel) methods.
//! When <hasVColors> is TRUE , you must use one of
//! AddVertex(Point,Color)
//! or AddVertex(Point,Normal,Color) methods.
//! When <hasTexels> is TRUE , you must use one of
//! AddVertex(Point,Texel)
//! or AddVertex(Point,Normal,Texel) methods.
//! When <hasBColors> is TRUE , <maxBounds> must be > 0 and
//! you must use the
//! AddBound(number,Color) method.
//! Warning:
//! the user is responsible about the orientation of the strip
//! depending of the order of the created vertex and this
//! orientation must be coherent with the vertex normal optionnaly
//! given at each vertex (See the Orientate() methods).
Standard_EXPORT Graphic3d_ArrayOfTriangleStrips(const Standard_Integer maxVertexs, const Standard_Integer maxStrips = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasSColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangleStrips,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of triangle strips, a polygon can be filled as:
//! 1) Creating a single strip defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangleStrips (7);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x7, y7, z7);
//! @endcode
//! 2) Creating separate strips defined with a predefined number of strips and the number of vertex per strip, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangleStrips (8, 2);
//! myArray->AddBound (4);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddBound (4);
//! myArray->AddVertex (x5, y5, z5);
//! ....
//! myArray->AddVertex (x8, y8, z8);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxStrips defines the maximum allowed strip number in the array;
//! the number of triangle really drawn is: VertexNumber() - 2 * Min(1, BoundNumber())
//! @param theHasVNormals when TRUE, AddVertex(Point,Normal), AddVertex(Point,Normal,Color) or AddVertex(Point,Normal,Texel) should be used to specify vertex normal;
//! vertex normals should be specified coherent to triangle orientation (defined by order of vertexes within triangle) for proper rendering
//! @param theHasVColors when TRUE, AddVertex(Point,Color) or AddVertex(Point,Normal,Color) should be used to specify vertex color
//! @param theHasBColors when TRUE, AddBound(number,Color) should be used to specify sub-group color
//! @param theHasVTexels when TRUE, AddVertex(Point,Texel) or AddVertex(Point,Normal,Texel) should be used to specify vertex UV coordinates
Graphic3d_ArrayOfTriangleStrips (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxStrips = 0,
const Standard_Boolean theHasVNormals = Standard_False,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasBColors = Standard_False,
const Standard_Boolean theHasVTexels = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLESTRIPS, theMaxVertexs, theMaxStrips, 0, theHasVNormals, theHasVColors, theHasBColors, theHasVTexels) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangleStrips, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfTriangleStrips_HeaderFile

View File

@@ -1,27 +0,0 @@
// Created on: 2001-01-04
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangles,Graphic3d_ArrayOfPrimitives)
Graphic3d_ArrayOfTriangles::Graphic3d_ArrayOfTriangles (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxEdges,
const Standard_Boolean theHasVNormals,
const Standard_Boolean theHasVColors,
const Standard_Boolean theHasVTexels)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLES, theMaxVertexs, 0, theMaxEdges, theHasVNormals, theHasVColors, Standard_False, theHasVTexels)
{}

View File

@@ -15,87 +15,50 @@
#ifndef _Graphic3d_ArrayOfTriangles_HeaderFile
#define _Graphic3d_ArrayOfTriangles_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Graphic3d_ArrayOfTriangles;
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangles, Graphic3d_ArrayOfPrimitives)
//! Contains triangles array definition
class Graphic3d_ArrayOfTriangles : public Graphic3d_ArrayOfPrimitives
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangles, Graphic3d_ArrayOfPrimitives)
public:
//! Creates an array of triangles,
//! a triangle can be filled as:
//! 1) creating a set of triangles defined with his vertexs.
//! i.e:
//! myArray = Graphic3d_ArrayOfTriangles(6)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x6,y6,z6)
//! 3) creating a set of indexed triangles defined with his vertex
//! ans edges.
//! i.e:
//! myArray = Graphic3d_ArrayOfTriangles(4,6)
//! myArray->AddVertex(x1,y1,z1)
//! ....
//! myArray->AddVertex(x4,y4,z4)
//! myArray->AddEdge(1)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(2)
//! myArray->AddEdge(3)
//! myArray->AddEdge(4)
//!
//! <maxVertexs> defined the maximun allowed vertex number in the array.
//! <maxEdges> defined the maximun allowed edge number in the array.
//! Warning:
//! When <hasVNormals> is TRUE , you must use one of
//! AddVertex(Point,Normal)
//! or AddVertex(Point,Normal,Color)
//! or AddVertex(Point,Normal,Texel) methods.
//! When <hasVColors> is TRUE , you must use one of
//! AddVertex(Point,Color)
//! or AddVertex(Point,Normal,Color) methods.
//! When <hasTexels> is TRUE , you must use one of
//! AddVertex(Point,Texel)
//! or AddVertex(Point,Normal,Texel) methods.
//! Warning:
//! the user is responsible about the orientation of the triangle
//! depending of the order of the created vertex or edges and this
//! orientation must be coherent with the vertex normal optionnaly
//! given at each vertex (See the Orientate() methods).
Standard_EXPORT Graphic3d_ArrayOfTriangles(const Standard_Integer maxVertexs, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangles,Graphic3d_ArrayOfPrimitives)
protected:
private:
//! Creates an array of triangles, a triangle can be filled as:
//! 1) Creating a set of triangles defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangles (6);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x6, y6, z6);
//! @endcode
//! 3) Creating a set of indexed triangles defined with his vertex and edges, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangles (4, 6);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
//! myArray->AddEdge (1);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (2);
//! myArray->AddEdge (3);
//! myArray->AddEdge (4);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxEdges defines the maximum allowed edge number in the array
//! @param theHasVNormals when TRUE, AddVertex(Point,Normal), AddVertex(Point,Normal,Color) or AddVertex(Point,Normal,Texel) should be used to specify vertex normal;
//! vertex normals should be specified coherent to triangle orientation (defined by order of vertexes within triangle) for proper rendering
//! @param theHasVColors when TRUE, AddVertex(Point,Color) or AddVertex(Point,Normal,Color) should be used to specify vertex color
//! @param theHasVTexels when TRUE, AddVertex(Point,Texel) or AddVertex(Point,Normal,Texel) should be used to specify vertex UV coordinates
Graphic3d_ArrayOfTriangles (const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxEdges = 0,
const Standard_Boolean theHasVNormals = Standard_False,
const Standard_Boolean theHasVColors = Standard_False,
const Standard_Boolean theHasVTexels = Standard_False)
: Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLES, theMaxVertexs, 0, theMaxEdges, theHasVNormals, theHasVColors, Standard_False, theHasVTexels) {}
};
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangles, Graphic3d_ArrayOfPrimitives)
#endif // _Graphic3d_ArrayOfTriangles_HeaderFile

View File

@@ -20,16 +20,29 @@
//! The type of primitive array in a group in a structure.
enum Graphic3d_TypeOfPrimitiveArray
{
Graphic3d_TOPA_UNDEFINED,
Graphic3d_TOPA_POINTS,
Graphic3d_TOPA_POLYLINES,
Graphic3d_TOPA_SEGMENTS,
Graphic3d_TOPA_POLYGONS,
Graphic3d_TOPA_TRIANGLES,
Graphic3d_TOPA_QUADRANGLES,
Graphic3d_TOPA_TRIANGLESTRIPS,
Graphic3d_TOPA_QUADRANGLESTRIPS,
Graphic3d_TOPA_TRIANGLEFANS
Graphic3d_TOPA_UNDEFINED, //!< undefined primitive type
// main rendering types
Graphic3d_TOPA_POINTS, //!< individual points
Graphic3d_TOPA_SEGMENTS, //!< segments array - each 2 vertexes define 1 segment
Graphic3d_TOPA_POLYLINES, //!< line strip - each new vertex in array defines segment with previous one
Graphic3d_TOPA_TRIANGLES, //!< triangle array - each 3 vertexes define 1 triangle
Graphic3d_TOPA_TRIANGLESTRIPS, //!< triangle strip - each new vertex in array defines triangle with 2 previous vertexes
Graphic3d_TOPA_TRIANGLEFANS, //!< triangle fan - each new vertex in array define triangle with the previous vertex and the very first vertex (fan center)
// rendering type with auxiliary adjacent info (can be accessed only within Geometry shader)
Graphic3d_TOPA_LINES_ADJACENCY, //!< ADVANCED - same as Graphic3d_TOPA_SEGMENTS, but each pair of vertexes defining 1 segment
//! is preceded by 1 extra vertex and followed by 1 extra vertex which are not actually rendered
Graphic3d_TOPA_LINE_STRIP_ADJACENCY, //!< ADVANCED - same as Graphic3d_TOPA_POLYLINES, but each sequence of vertexes defining 1 polyline
//! is preceded by 1 extra vertex and followed by 1 extra vertex which are not actually rendered
Graphic3d_TOPA_TRIANGLES_ADJACENCY, //!< ADVANCED - same as Graphic3d_TOPA_TRIANGLES, but each vertex defining of triangle
//! is followed by 1 extra adjacent vertex which is not actually rendered
Graphic3d_TOPA_TRIANGLE_STRIP_ADJACENCY, //!< ADVANCED - same as Graphic3d_TOPA_TRIANGLESTRIPS, but with extra adjacent vertexes
// deprecated types, unsupported by mobile hardware
Graphic3d_TOPA_QUADRANGLES, //!< DEPRECATED - triangle array should be used instead;
//! array of quads - each 4 vertexes define single quad
Graphic3d_TOPA_QUADRANGLESTRIPS, //!< DEPRECATED - triangle array should be used instead;
//! quad strip - each 2 new vertexes define a quad shared 2 more vertexes of previous quad
Graphic3d_TOPA_POLYGONS //!< DEPRECATED - triangle array should be used instead;
//! array defines a polygon
};
#endif // _Graphic3d_TypeOfPrimitiveArray_HeaderFile

View File

@@ -16,11 +16,17 @@
#ifndef _Graphic3d_TypeOfShaderObject_HeaderFile
#define _Graphic3d_TypeOfShaderObject_HeaderFile
//! Type of the shader object (may be extended).
//! Type of the shader object.
enum Graphic3d_TypeOfShaderObject
{
Graphic3d_TOS_VERTEX,
Graphic3d_TOS_FRAGMENT
// rendering shaders
Graphic3d_TOS_VERTEX = 0x01, //!< vertex shader object, mandatory
Graphic3d_TOS_TESS_CONTROL = 0x02, //!< tessellation control shader object, optional
Graphic3d_TOS_TESS_EVALUATION = 0x04, //!< tessellation evaluation shader object, optional
Graphic3d_TOS_GEOMETRY = 0x08, //!< geometry shader object, optional
Graphic3d_TOS_FRAGMENT = 0x10, //!< fragment shader object, mandatory
// general-purpose compute shader
Graphic3d_TOS_COMPUTE = 0x20 //!< compute shader object, should be used as alternative to shader object types for rendering
};
#endif