The PaintableTexture class allows modifications of the pixel data in a texture on the fly, allowing for the user to paint in a texture.
More...
#include <PaintableTexture.h>
List of all members.
Classes |
| class | DrawingModeField |
| class | PainterField |
Public Member Functions |
| | PaintableTexture (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _repeatS=0, Inst< SFBool > _repeatT=0, Inst< SFBool > _scaleToP2=0, Inst< SFImage > _image=0, Inst< SFTextureProperties > _textureProperties=0, Inst< SFInt32 > _width=0, Inst< SFInt32 > _height=0, Inst< PainterField > _paintAtTexCoord=0, Inst< SFBool > _isHaptic=0, Inst< SFBool > _isInContact=0, Inst< DrawingModeField > _isInDrawingMode=0, Inst< SFBool > _mouseButtonIsPressed=0, Inst< SFBool > _mainButtonIsPressed=0) |
| | Constructor.
|
| | ~PaintableTexture (void) |
| | Destructor.
|
| virtual void | initialize () |
| void | flushHapticPoints () |
| void | drawHapticPoints (wxPoint pos) |
| Cairo::RefPtr< Cairo::Context > | beginDraw () |
| void | endDraw () |
| void | setDefaultBackground () |
| void | setDefaultForeground () |
| void | setEvtHandler (wxEvtHandler *evtHandler) |
| virtual Field * | getField (const string &name) |
| void | savePenOptions (bool *white, int *width) |
| void | loadPenOptions () |
Public Attributes |
| Cairo::RefPtr< Cairo::Context > | context |
Cairo::RefPtr
< Cairo::ImageSurface > | surface |
| FIBITMAP * | png |
| FreeImageImage * | fii |
| std::deque< wxPoint > | bufPoints |
| auto_ptr< SFInt32 > | width |
| auto_ptr< SFInt32 > | height |
| auto_ptr< PainterField > | paintAtTexCoord |
| auto_ptr< SFBool > | isHaptic |
| auto_ptr< SFBool > | isInContact |
| auto_ptr< DrawingModeField > | isInDrawingMode |
| auto_ptr< SFBool > | mainButtonIsPressed |
| auto_ptr< SFBool > | mouseButtonIsPressed |
| wxSize | windowSize |
Static Public Attributes |
| static const Cairo::Format | visual_format = Cairo::FORMAT_ARGB32 |
| static const Cairo::Format | haptic_format = Cairo::FORMAT_A8 |
| static H3DNodeDatabase | database |
| | The H3DNodeDatabase for this node.
|
Protected Attributes |
| wxEvtHandler * | evtHandler |
| vector< wxPoint * > | points |
| bool * | penWhitePtr |
| int * | penWidthPtr |
Detailed Description
The PaintableTexture class allows modifications of the pixel data in a texture on the fly, allowing for the user to paint in a texture.
The width and height fields are initializeOnly fields for setting the resolution of the image in pixels.
Painting will occur when the paintAtTexCoord field receives an event
Constructor & Destructor Documentation
| PaintableTexture::PaintableTexture |
( |
Inst< DisplayList > |
_displayList = 0, |
|
|
Inst< SFNode > |
_metadata = 0, |
|
|
Inst< SFBool > |
_repeatS = 0, |
|
|
Inst< SFBool > |
_repeatT = 0, |
|
|
Inst< SFBool > |
_scaleToP2 = 0, |
|
|
Inst< SFImage > |
_image = 0, |
|
|
Inst< SFTextureProperties > |
_textureProperties = 0, |
|
|
Inst< SFInt32 > |
_width = 0, |
|
|
Inst< SFInt32 > |
_height = 0, |
|
|
Inst< PainterField > |
_paintAtTexCoord = 0, |
|
|
Inst< SFBool > |
_isHaptic = 0, |
|
|
Inst< SFBool > |
_isInContact = 0, |
|
|
Inst< DrawingModeField > |
_isInDrawingMode = 0, |
|
|
Inst< SFBool > |
_mouseButtonIsPressed = 0, |
|
|
Inst< SFBool > |
_mainButtonIsPressed = 0 | |
|
) |
| | |
| PaintableTexture::~PaintableTexture |
( |
void |
|
) |
|
Member Function Documentation
| Cairo::RefPtr< Cairo::Context > PaintableTexture::beginDraw |
( |
|
) |
|
| void PaintableTexture::drawHapticPoints |
( |
wxPoint |
pos |
) |
|
| void PaintableTexture::endDraw |
( |
|
) |
|
| void PaintableTexture::flushHapticPoints |
( |
|
) |
|
- Todo:
- : Doesn't draw the last point until the next time, sometimes...
| Field * PaintableTexture::getField |
( |
const string & |
name |
) |
[virtual] |
| void PaintableTexture::initialize |
( |
|
) |
[virtual] |
Initializes the texture to the specified resolution and background color.
| void PaintableTexture::loadPenOptions |
( |
|
) |
|
| void PaintableTexture::savePenOptions |
( |
bool * |
white, |
|
|
int * |
width | |
|
) |
| | |
| void PaintableTexture::setDefaultBackground |
( |
|
) |
|
| void PaintableTexture::setDefaultForeground |
( |
|
) |
|
| void PaintableTexture::setEvtHandler |
( |
wxEvtHandler * |
evtHandler |
) |
|
Member Data Documentation
The H3DNodeDatabase for this node.
The height of the image to paint(number of pixels).
Default value: 128
Indicates whether or not the texture is haptic.
Default value: false
Indicated whether or not the haptic pointer is in contact with the texture.
Default value: empty
Indicates whether or not the user is currently drawing a new curve
Default value: false
Indicates whether or not the main button is pressed
Default value: false
Indicates whether or not the mouse button is pressed
Default value: false
When an event is received on this field the pixel with the given texture coordinate will be painted.
Default value: RGBA( 0, 0, 0, 1 )
The width of the image to paint(number of pixels).
Default value: 128
The documentation for this class was generated from the following files: