9#include <Inventor/nodes/SoDrawStyle.h>
10#include <Inventor/nodes/SoSeparator.h>
11#include <Inventor/elements/SoViewportRegionElement.h>
12#include <Inventor/elements/SoCacheElement.h>
13#include <Inventor/errors/SoDebugError.h>
29 [[maybe_unused]]
static const bool didInit = [&]() {
38 const SbViewportRegion& aViewPortRegion
40:SoGLRenderAction(aViewPortRegion)
66 const SbString& aOptions
72 int wordn = words.getLength();
73 for(
int wordi=0;wordi<wordn;wordi++) {
74 SbString& word = *((SbString*)words[wordi]);
75 if(!word.getLength())
continue;
80 if(o_v.getLength()==2) {
81 option = *((SbString*)o_v[0]);
82 SbString svalue = *((SbString*)o_v[1]);
84 SoDebugError::postInfo(
"SoGL2PSAction::setPageOptions",
85 "value \"%s\" not a bool.\n",svalue.getString());
93#define SET_OPT(a_opt) \
95 m_pageOptions |= a_opt;\
97 m_pageOptions &= ~a_opt;\
100 if(option==
"DEFAULTS") {
105 }
else if(option==
"NONE") {
107 }
else if(option==
"DRAW_BACKGROUND") {
109 }
else if(option==
"SIMPLE_LINE_OFFSET") {
111 }
else if(option==
"SILENT") {
113 }
else if(option==
"BEST_ROOT") {
115 }
else if(option==
"OCCLUSION_CULL") {
117 }
else if(option==
"NO_TEXT") {
119 }
else if(option==
"LANDSCAPE") {
121 }
else if(option==
"NO_PS3_SHADING") {
123 }
else if(option==
"NO_PIXMAP") {
125 }
else if(option==
"USE_CURRENT_VIEWPORT") {
127 }
else if(option==
"COMPRESS") {
129 }
else if(option==
"NO_BLENDING") {
131 }
else if(option==
"TIGHT_BOUNDING_BOX") {
134 SoDebugError::postInfo(
"SoGL2PSAction::setPageOptions",
135 "bad option \"%s\".\n",option.getString());
146 const char* aFileName
165 SoDebugError::post(
"SoGL2PSAction::enableFileWriting",
166 "Cannot open file %s",
m_fileName.getString());
185 return (
m_file?TRUE:FALSE);
201 glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID,&valid);
202 if(valid==GL_FALSE)
return FALSE;
204 glGetFloatv(GL_CURRENT_RASTER_POSITION,pos);
205 int xoff = -(int)(aXmove + aXorig);
206 int yoff = -(int)(aYmove + aYorig);
207 int x = (int)(pos[0] + xoff);
208 int y = (int)(pos[1] + yoff);
211 glGetIntegerv(GL_VIEWPORT,vp);
214 if(
x+w>(vp[0]+vp[2])) w = vp[0]+vp[2]-
x;
215 if(
y+
h>(vp[1]+vp[3]))
h = vp[1]+vp[3]-
y;
217 if(s<=0)
return FALSE;
218 float* image =
new float[s];
219 glReadPixels(
x,
y,w,
h,GL_RGB,GL_FLOAT,image);
233 glGetIntegerv(GL_VIEWPORT,vp);
262 const SbViewportRegion& vpr = getViewportRegion();
263 SoViewportRegionElement::set(getState(),vpr);
270 SoGLRenderAction::beginTraversal(aNode);
284 const SbViewportRegion& vpr = getViewportRegion();
285 SoViewportRegionElement::set(getState(),vpr);
287 const SbVec2s& win = vpr.getWindowSize();
300 GL_RGBA,0, NULL,0,0,0,
319 aNode->doAction(aThis);
321 SoNode::GLRenderS(aThis,aNode);
332 SoNode::GLRenderS(aThis,aNode);
335 SoDrawStyle* soDrawStyle =
static_cast<SoDrawStyle*
>(aNode);
336 if(soDrawStyle->style.getValue()==SoDrawStyle::LINES) {
337 float w = soDrawStyle->lineWidth.getValue();
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
SbPList SbStringGetWords(const SbString &aString, const char *aLimiter)
SbBool SbStringConvertToBool(const SbString &aString, SbBool &aValue)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void SbStringDelete(SbPList &aList)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Header file for AthHistogramAlgorithm.
SoGL2PSAction inherits Inventor/SoGLRenderAction.
SoGL2PSAction(const SbViewportRegion &)
void setFileFormat(Format)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setFileName(const char *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void endViewport()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void gl2psBegin()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void enableFileWriting()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual void beginTraversal(SoNode *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void disableFileWriting()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void separatorAction(SoAction *, SoNode *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SbBool addBitmap(int, int, float=0, float=0, float=0, float=0)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void drawStyleAction(SoAction *, SoNode *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SbBool fileWritingEnabled() const
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void beginViewport(SbBool draw_back=TRUE)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SbBool setPageOptions(const SbString &options)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
GL2PSDLL_API GLint gl2psEndViewport(void)
GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, GLint xorig, GLint yorig, GLenum format, GLenum type, const void *pixels)
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, GLint viewport[4], GLint format, GLint sort, GLint options, GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint nr, GLint ng, GLint nb, GLint buffersize, FILE *stream, const char *filename)
GL2PSDLL_API GLint gl2psSetOptions(GLint options)
GL2PSDLL_API GLint gl2psDisable(GLint mode)
GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4])
GL2PSDLL_API GLint gl2psEndPage(void)
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value)
GL2PSDLL_API GLint gl2psGetOptions(GLint *options)
#define GL2PS_TIGHT_BOUNDING_BOX
#define GL2PS_NO_BLENDING
#define GL2PS_SIMPLE_LINE_OFFSET
#define GL2PS_OCCLUSION_CULL
#define GL2PS_LINE_STIPPLE
#define GL2PS_DRAW_BACKGROUND
#define GL2PS_NO_PS3_SHADING
#define GL2PS_USE_CURRENT_VIEWPORT