|
ATLAS Offline Software
|
Go to the documentation of this file.
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 = [&]() {
31 SO_ACTION_ADD_METHOD(SoSeparator,separatorAction);
32 SO_ACTION_ADD_METHOD(SoDrawStyle,drawStyleAction);
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());
201 glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID,&
valid);
204 glGetFloatv(GL_CURRENT_RASTER_POSITION,
pos);
205 int xoff = -(
int)(aXmove + aXorig);
206 int yoff = -(
int)(aYmove + aYorig);
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;
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();
270 SoGLRenderAction::beginTraversal(aNode);
284 const SbViewportRegion& vpr = getViewportRegion();
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 = (SoDrawStyle*)aNode;
337 float w = soDrawStyle->lineWidth.getValue();
GL2PSDLL_API GLint gl2psSetOptions(GLint options)
def traverse(graph, root, reverse=False, maxdepth=None, nodegetter=lambda n:n)
GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, GLint xorig, GLint yorig, GLenum format, GLenum type, const void *pixels)
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value)
void gl2psBegin()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SoGL2PSAction(const SbViewportRegion &)
SbBool SbStringConvertToBool(const SbString &aString, SbBool &aValue)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SbBool addBitmap(int, int, float=0, float=0, float=0, float=0)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
bool const RAWDATA *ch2 const
#define GL2PS_DRAW_BACKGROUND
#define GL2PS_TIGHT_BOUNDING_BOX
std::unique_ptr< TFile > m_file
description: this is a custom writer for the old-school drivers that don't use an actual writer
SbPList SbStringGetWords(const SbString &aString, const char *aLimiter)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void endViewport()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
#define GL2PS_NO_BLENDING
SbBool setPageOptions(const SbString &options)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
GL2PSDLL_API GLint gl2psEndViewport(void)
bool TRUE
for job options legacy (TODO: get rid of these!) ----------------------—
void enableFileWriting()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void disableFileWriting()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
#define GL2PS_LINE_STIPPLE
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
void SbStringDelete(SbPList &aList)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SbBool fileWritingEnabled() const
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
SoGL2PSAction inherits Inventor/SoGLRenderAction.
GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4])
GL2PSDLL_API GLint gl2psGetOptions(GLint *options)
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)
#define GL2PS_USE_CURRENT_VIEWPORT
#define GL2PS_NO_PS3_SHADING
virtual void beginTraversal(SoNode *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static void separatorAction(SoAction *, SoNode *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
#define GL2PS_OCCLUSION_CULL
void setFileName(const char *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
GL2PSDLL_API GLint gl2psDisable(GLint mode)
#define GL2PS_SIMPLE_LINE_OFFSET
static void drawStyleAction(SoAction *, SoNode *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
void setFileFormat(Format)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
GL2PSDLL_API GLint gl2psEndPage(void)
void beginViewport(SbBool draw_back=TRUE)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//