OpenSceneGraph 3.6.5
PatchParameter
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_PATCHPARAMETER
15#define OSG_PATCHPARAMETER 1
16
17#include <osg/Vec2>
18#include <osg/Vec4>
19#include <osg/StateAttribute>
20
21namespace osg {
22
26{
27 public :
28
29 PatchParameter(GLint vertices=3);
30
37
38
40
42 virtual int compare(const StateAttribute& sa) const
43 {
44 // check the types are equal and then create the rhs variable
45 // used by the COMPARE_StateAttribute_Parameter macros below.
47
48 // compare each parameter in turn against the rhs.
52
53 return 0; // passed all the above comparison macros, must be equal.
54 }
55
57 void setVertices(GLint vertices) { _vertices = vertices; }
58
60 GLint getVertices() const { return _vertices; }
61
64
67
70
73
74 virtual void apply(State& state) const;
75
76 protected:
77
78 virtual ~PatchParameter();
79
80 GLint _vertices;
83};
84
85}
86
87#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec2f Vec2
Definition Vec2:21
Vec4f Vec4
Definition Vec4:21
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
const osg::Vec2 & getPatchDefaultInnerLevel() const
Get GL_PATCH_DEFAULT_INNER_LEVEL parameter.
Definition PatchParameter:66
virtual ~PatchParameter()
void setPatchDefaultInnerLevel(const osg::Vec2 &level)
Set GL_PATCH_DEFAULT_INNER_LEVEL parameter.
Definition PatchParameter:63
osg::Vec2 _patchDefaultInnerLevel
Definition PatchParameter:81
PatchParameter(GLint vertices=3)
GLint _vertices
Definition PatchParameter:80
virtual int compare(const StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition PatchParameter:42
void setVertices(GLint vertices)
Set GL_PATCH_VERTICES parameter.
Definition PatchParameter:57
const osg::Vec4 & getPatchDefaultOuterLevel() const
Get GL_PATCH_DEFAULT_INNER_LEVEL parameter.
Definition PatchParameter:72
virtual void apply(State &state) const
apply the OpenGL state attributes.
GLint getVertices() const
Get GL_PATCH_VERTICES parameter.
Definition PatchParameter:60
void setPatchDefaultOuterLevel(const osg::Vec4 &level)
Set GL_PATCH_DEFAULT_OUTER_LEVEL parameter.
Definition PatchParameter:69
META_StateAttribute(osg, PatchParameter, PATCH_PARAMETER)
osg::Vec4 _patchDefaultOuterLevel
Definition PatchParameter:82
PatchParameter(const PatchParameter &rhs, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition PatchParameter:32
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
@ PATCH_PARAMETER
Definition StateAttribute:197
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.