BrushOperation Class Reference

#include <brush.h>

Class Description

The BrushOperation class is the base class for brush functionality.

A plugin can implement its own operation class derived from BrushOperation, which will be available for the users in the tools tray. Note that if there is any change in the available operations (like a new plugin is installed with such functions) the settings directory has to be deleted. The implementations of this class must use the DECLARE_CLASS and IMPLEMENT_CLASS macros.

+ Examples:

Definition at line 267 of file brush.h.

+ Inheritance diagram for BrushOperation:

Classes

struct  BrushBehavior
 Tool behaviour structure for storing alternate brushing modes. More...
 
struct  PatchParameters
 

Public Types

enum  FalloffType { eFalloffHybrid = 0, eFalloffSurface, eFalloffVolume }
 Values for the falloff type property. More...
 
enum  Direction {
  eDirNormal, eDirAveragedNormal, eDirVertexNormal, eDirForward,
  eDirRight, eDirX, eDirY, eDirZ,
  eDirCamera, eDirScreen, eDirXY, eDirXZ,
  eDirYZ
}
 Values for the brush direction property. More...
 
enum  Modifier { eModNormal, eModAdditive, eModInverted, eModNoEffect }
 Values for the brush effect modifier. More...
 
enum  TriggerType { eTriggerPrimary, eTriggerSecondary, eTriggerTertiary }
 This value represents how the user triggered the brush. More...
 
enum  MaskType { eMaskAny = -1, eMaskStamp, eMaskStencil, eMaskTypeCount }
 Values for mask types that can be add to the brush effect as a multiplier. More...
 
enum  StampSizingMode { eStampSizingNone, eStampSizingRadius, eStampSizingDiameter }
 Values for stamp resizing mode. More...
 
- Public Types inherited from Node
enum  DiagnosticLevel { dgnLevel1, dgnLevel2, dgnLevel3 }
 Indicates the level of validity checking that is performed in CheckValidity() More...
 

Public Member Functions

 BrushOperation (void)
 Constructor, do not use it directly. More...
 
virtual QString StringID (const ClassDesc *pClass=0) const
 Returns the string id of the current brush operation. More...
 
virtual QString DisplayName (void) const
 Returns the display name of the current brush operation. More...
 
virtual void OnNodeEvent (const Attribute &cAttribute, NodeEventType eType)
 Overriding the node event. More...
 
virtual bool IsScreenSpace (void) const
 Returns if the brush is in screen space. More...
 
virtual float BrushSize (void) const
 Returns the size of the active brush. More...
 
virtual float BrushStrength (void) const
 Returns the strength of the active brush. More...
 
virtual void SetBrushSize (float fSize)
 Sets the size of the active brush. More...
 
virtual void SetBrushStrength (float fStrength)
 Sets the strength of the active brush. More...
 
virtual float EffectiveBrushSize (void) const
 Returns the size of the active brush including the scaling parameter. More...
 
virtual float EffectiveBrushStrength (void) const
 Returns the strength of the active brush including the scaling parameter. More...
 
virtual float BrushSizeBias (void) const
 Returns the size bias percentage. More...
 
virtual float BrushStrengthBias (void) const
 Returns the strength bias percentage. More...
 
virtual float MaxBrushSize (void) const
 Returns the maximal brush size. More...
 
virtual float MaxBrushStrength (void) const
 Returns the maximal brush strength. More...
 
virtual bool UsesStrokeSmoothing (void) const
 Returns true if the brush wants to use drawing curve. More...
 
virtual float StrokeSmoothingDistance (void) const
 Returns the distance parameter for smoothing if the brush uses drawing curve. More...
 
virtual void SetStrokeSmoothing (bool bEnable, float fDistance)
 Convenience function for setting Stroke smoothing parameters. More...
 
virtual bool HasCustomCursor (void)
 Returns true if the brush wants to draw the cursor on it's own. More...
 
virtual bool UsesSteadyStroke (void) const
 Returns true if the brush wants to use drawing curve. More...
 
virtual float SteadyStrokeDistance (void) const
 Returns the distance parameter for smoothing if the brush uses drawing curve. More...
 
virtual void SetSteadyStroke (bool bEnable, float fDistance)
 Convenience function for setting Stroke smoothing parameters. More...
 
virtual enum StampSizingMode StampSizingMode (void) const
 Returns the current stamp sizing mode. More...
 
virtual void SetStampSizingMode (enum StampSizingMode eMode)
 Sets the current stamp sizing mode. More...
 
virtual const NURBSCurveFalloff (void) const
 Returns the falloff curve. More...
 
virtual void SetFalloff (NURBSCurve *pCurve)
 Sets the falloff curve. More...
 
virtual const Store< float > & FalloffData (void) const
 Returns the current falloff table. More...
 
float FalloffValue (float fValue) const
 Returns the falloff value in the specified curve position. More...
 
virtual bool UsesFalloffBasedOnFacingAngle (void) const
 Returns true if Falloff based on Facing Angle is on. More...
 
virtual void SetFalloffBasedOnFacingAngle (bool bEnable)
 Set Falloff based on Facing Angle. More...
 
void SetFalloffType (FalloffType eType)
 Set falloff type. More...
 
FalloffType GetFalloffType () const
 Returns the falloff type. More...
 
virtual bool UsesStampRandomize (void) const
 Returns true if Stamp Randomize is on. More...
 
virtual void SetStampRandomize (bool bEnable)
 Set Falloff based on Facing Angle. More...
 
virtual bool IsMaskEnabled (MaskType type=eMaskAny) const
 Returns true if the mask is turned on for the brush. More...
 
virtual const ImageMaskImage (MaskType type=eMaskAny) const
 Returns the current mask image. More...
 
virtual Matrix MaskMatrix (MaskType type=eMaskAny) const
 Returns the current matrix of the mask. More...
 
virtual bool IsMaskInverted (MaskType type=eMaskAny) const
 Returns whether the value should be inverted or not (inversion means 1-x) More...
 
virtual float MaskFactor (MaskType type=eMaskAny) const
 Returns the factor value, which should be multiplied to the mask value. More...
 
virtual bool IsMaskTiled (MaskType type=eMaskAny) const
 Returns true if the mask shall tile, and false if all the values outside the mask should be treated as zero. More...
 
virtual QString MaskName (MaskType type=eMaskAny) const
 Returns a string identifier which is unique for this mask. More...
 
virtual bool MaskBuildUp (MaskType type=eMaskAny) const
 Returns true if the mask should be included in buildup or not. More...
 
virtual const ImageMaskOpacityImage (MaskType type=eMaskAny) const
 Returns the effective area of the mask as an image. Use this to restrict the mask effect to certain pixels. More...
 
virtual float MaskOffset (MaskType type=eMaskAny) const
 Returns the offset of the mask. More...
 
virtual void OnMaskChanged (MaskType type=eMaskAny)
 Called by the kernel when the active stamp or stencil is changed on the UI. Override if you want to be notified when this happens. More...
 
virtual float BuildUpRate (void) const
 Returns the current build up rate (between 0 and 1). More...
 
virtual bool PatchesAtRelease (void) const
 Returns if the patchs should be applied at the end of stroke. More...
 
virtual bool PressureControlsBrushSize (void) const
 Returns if the pressure affects brush size. More...
 
virtual bool PressureControlsBrushStrength (void) const
 Returns if the pressure affects brush strength. More...
 
virtual bool IsInverted (void) const
 Returns the mode if inverted or not. More...
 
virtual bool IsOrientedToSurface (void) const
 Returns if the brush is aligned to the surface. More...
 
virtual void SetOrientedToSurface (bool bOriented)
 Sets if the brush is aligned to the surface. More...
 
virtual bool IsStrokeOnCurveEnabled (void) const
 Returns if the brush can be used as a tool for Stroke on curve function. More...
 
Direction Direction (void) const
 Returns the direction type. More...
 
virtual void SetDirectionVector (const Vector &vDirection) const
 When the current direction is calculated properly, the operation may want to call this routine to use the direction for the stamp transformation. More...
 
Vector PreviousPatchPosition (void) const
 Return the local position of the previous patch in this stroke. More...
 
virtual void BeginStroke (Mesh *pMesh, Modifier eModifier, TriggerType eTriggerType)
 Called when a new stroke is started. More...
 
virtual void EndStroke (void)
 Called when a stroke is finished. More...
 
virtual void MouseMove (float fXPosition, float fYPosition, float fXDelta, float fYDelta, AxisAlignedBoundingBox &cDirtyWorldArea, float fPressure)
 Called when the mouse is moved during a stroke. The default implementation calls AddPatch(). Positions are in range [0,1]. More...
 
virtual void AddPatch (const SurfacePoint *pPoint, const Vector &vPatchCenter, float fSize, float fPressure, float fStrength, AxisAlignedBoundingBox &cDirtyWorldArea)
 Called when a new surface point has to be added to the stroke. More...
 
virtual void Flood (Mesh *pTarget, float fStrength=1.0f, bool bFromCamera=false)
 Flood a mesh with the effect of the brush. More...
 
void SetPatchParameters (const SurfacePoint *pS, float fSize, float fStrength, Vector vMove)
 Set the effective parameters at the time of adding a patch. More...
 
float EffectiveBrushSize (void)
 Returns the size at patch time modified by pressure, stamp randomize and other possible factors. More...
 
float EffectiveBrushStrength (void)
 Returns the strength at patch time modified by pressure, stamp randomize and other possible factors. More...
 
virtual void SetActiveConfiguration (BrushConfiguration *config)
 Changes to the configuration. More...
 
virtual void SetActiveConfiguration (const QString &sName)
 Changes to the configuration. More...
 
virtual BrushConfigurationActiveConfiguration (void) const
 Returns the active configuration. More...
 
virtual void ResetBrushConfiguration (void)
 Reset the configuration to default. More...
 
const StampConfigurationStampConfig (void) const
 Returns the structure with stamp properties. More...
 
void SetStampConfig (StampConfiguration &newConfig)
 Sets stamp configuration. More...
 
void SetStamp (bool bEnable, const QString &sFileName="")
 Convenience method for enabling stamp and setting stamp image. More...
 
void SetBrushSizeScale (float fScale)
 Set the scale amount of size according to the brush configuration. More...
 
void SetBrushStrengthScale (float fScale)
 Set the scale amount of strength according to the brush configuration. More...
 
bool UsesGlobalBrushSize (void) const
 Returns if the brush uses the global size. More...
 
Modifier CurrentModifier (void) const
 Returns the current modifier of the brush. More...
 
const MirrorConfigurationMirrorConfig (void) const
 Returns the mirror configuration. More...
 
virtual void SetMirrorConfig (MirrorConfiguration newConfig)
 Sets mirror configuration. More...
 
virtual bool IsConfigurationInited (BrushConfiguration *config) const
 Returns if we already initialized the configuration with the default values. More...
 
virtual void StoreConfiguration (BrushConfiguration *config)
 Saves the configuration state (the attribute values) into memory The parameter is the configuration index defined in the config declaration. More...
 
virtual void RestoreConfiguration (BrushConfiguration *config)
 Reloads the configuration state from the saved buffer so it restores the same state when it was active last time. More...
 
virtual QString OverlayIcon (void)
 Returns the file name to be displayed as an overlay icon above the cursor. More...
 
virtual QPointF OverlayOffset (void)
 Returns an (x, y) offset relative to the mouse cursor where the icon should be displayed. More...
 
virtual bool ExecuteAndInvert (void)
 For storing and restoring undo/redo data. More...
 
virtual void Serialize (Stream &s)
 Serializing. More...
 
virtual BrushOperationoperator= (const BrushOperation &op)
 Value assignment operator. More...
 
virtual bool CanLockLayer (void) const
 Returns if using the brush will lock the active layer to the current subdivision level so it cannot be modified on other levels later. More...
 
virtual bool CustomPicker (void)
 Brushes can implement their own picker and return true if they handle picking in their own. More...
 
virtual NodeAttributeHolderNode (void)
 Returns the node that contains the displayed attribute list of the operation. More...
 
virtual void SetFalloffIndex (int iIndex)
 Internal use only. More...
 
virtual int FalloffIndex (void) const
 Internal use only. More...
 
virtual unsigned int AlternateBehaviorCount (void) const
 Returns the number of possible alternate behaviors for the brush. More...
 
virtual const BrushBehaviorAlternateBehavior (unsigned int iIndex) const
 Returns the given alternate behavior instance. More...
 
virtual bool IsSnapToCurve (void) const
 Returns true if snap mouse to active curve. More...
 
virtual float SnapDistance (void) const
 Returns the distance tolerance when snapping mouse to curves. More...
 
bool StrokeInterrupted (void) const
 Returns true if the stroke was interrupted, for example if the tool opened a window mid-stroke. More...
 
virtual bool ShowBrushInStroke (void) const
 Returns if the brush ring should be visible during the stroke. More...
 
virtual void SetConstrainToSurface (bool bCts)
 Sets if the brush should keep the surface curvature. More...
 
virtual bool ConstrainToSurface () const
 Returns ture if the stroke keep the surface curvature. More...
 
- Public Member Functions inherited from Node
 Node (const QString &sStringID="", const QString &sDisplayName="")
 Standard constructor. More...
 
virtual ~Node (void)
 
virtual void Initialize (void)
 
void LoadTemplate (const QString &sFileName="", bool bStartEvent=false)
 Use an external XML file to initialize the attributes. More...
 
void SaveTemplate (const QString &sFileName="", bool bSaveOnlyVisible=false)
 Save current attributes as an XML template. More...
 
unsigned int Version (void) const
 Returns the current version of the node. This number increases when the content of the node changed (when ContentChanged() called). More...
 
void SetVersion (unsigned int iVersion)
 Sets the current version number for the node. More...
 
unsigned int ReferenceCount (void) const
 Returns the number of pointers referencing this node. More...
 
AttributeReferencePointer (unsigned int iIndex) const
 Returns the address of an attribute which refers to this node. The type of the attribute is always aptr. More...
 
NodeReferenceNode (unsigned int iIndex) const
 Returns the address of a node referencing this node. More...
 
virtual QString Name (const ClassDesc *pClass=0) const
 Deprecated. More...
 
virtual void SetName (const QString &sName)
 Deprecated. More...
 
virtual void SetStringID (const QString &sStringID)
 Sets the string id of the node. More...
 
virtual void SetDisplayName (const QString &sDisplayName)
 Sets the display name of the node. More...
 
virtual QString HelpID (void) const
 Returns the help entry id of the node. Can be overwritten in derived classes. More...
 
virtual void SetHelpID (const QString &sHelpID)
 Sets the help entry id of the node. More...
 
void Annex (Node *pSource, const QString &sCategory="")
 Relink all the attributes of the source node to this one. More...
 
bool IsKindOf (const ClassDesc *pClass) const
 Returns true if this node is derived from the pClass class. More...
 
void ContentChanged (void) const
 This function must be called if the content of the node is changed. More...
 
virtual void CheckValidity (DiagnosticLevel iLevel=dgnLevel2) const
 Checks the validity of this node. More...
 
virtual void CopyTo (Node *pNode) const
 
virtual NodeDuplicate (void) const
 
virtual void OnEvent (const EventGate &cEvent)
 This function is called when a generic event occurs. See EventGate class. More...
 
void RequestDeferredEvent (Attribute &cAttribute)
 Request for a deferred event, which will occur only in the main loop. More...
 
unsigned int AttributeCount (void) const
 Returns the number of attributes owned by the node. More...
 
AttributeAttributeByIndex (int iIndex) const
 Returns a specified attribute (or 0 if iIndex is greater than the number of attributes). More...
 
AttributeAttributeByName (const QString &sName) const
 Returns a specified attribute by its name. Returns 0 if the attribute not found. More...
 
AttributeAttributeByID (const QString &sID) const
 Returns a specified attribute by its ID. Returns 0 if the attribute not found. More...
 
void SetAttributeValue (const QString &sAttributeID, const QString &sNewValue)
 Set the value of an attribute from a string. More...
 
QString AttributeValue (const QString &sAttributeID) const
 Returns the current value of an attribute as a string. More...
 
void LogAttributes (void) const
 Write all attributes into the log file. More...
 
virtual QWidgetCreatePropertiesWindow (QWidget *pParent)
 Create a window which displays the attributes of the node. Can be overriden to provide a custom interface. More...
 
AttributeAddAttribute (Attribute::AttributeType type, const QString &id)
 Allows SDK users to add attributes at runtime. More...
 
NodeNext (void) const
 Returns the next node in the chain. Used to enumerate the current nodes. See also First(). More...
 
int ID (void) const
 Returns an ID for the node. The ID is unique in the whole application life. More...
 
bool SetID (int iID)
 Set ID for the node. More...
 

Static Public Member Functions

static void AddConfiguration (BrushConfiguration *config)
 Add a new configuration. More...
 
static unsigned int ConfigurationCount (void)
 Returns the number of configurations. More...
 
static BrushConfigurationConfiguration (unsigned int iIndex)
 Returns a configuration. More...
 
static void ClearConfigurations (void)
 Clear out all brush configurations. More...
 
static void SerializeConfigurationStates (Stream &s)
 Saves/loads the current states of the brushes to/from the given stream. More...
 
- Static Public Member Functions inherited from Node
static void StartHashing ()
 This is called once in main once static ctors are done. More...
 
static NodeFirst (void)
 This function will return the first node in the memory. Used to enumerate all the current nodes. See also Next(). More...
 
static NodeByID (int iID)
 Returns the node with the specified ID, or zero if such a node does not exists. More...
 
static NodeByName (const QString &sClass, const QString &sName)
 Search for a node with the name sName. More...
 

Protected Attributes

abool m_bScreenSpace
 ATTRIBUTES: More...
 
abool m_bInverted
 
abool m_bOrientToSurface
 
afloatr m_fNormalBrushSize
 
afloatr m_fNormalBrushStrength
 
afloatr m_fScreenBrushSize
 
afloatr m_fScreenBrushStrength
 
afloatr m_fMaxBrushSize
 
afloatr m_fMaxBrushStrength
 
afloatr m_fBrushSizeBias
 
afloatr m_fBrushStrengthBias
 
acheckablefloat m_fStrokeSmoothing
 
acheckablefloat m_fSteadyStroke
 
abool m_bRememberSize
 
aenum m_iDirection
 
astampcfg m_cStampCfg
 
amirrorcfg m_cMirrorCfg
 
aevent m_cFlood
 
aevent m_cFloodFromCamera
 
avoid m_vPressure
 
acurveptr m_cFalloff
 
aint m_iFalloffIndex
 
aptr< NURBSCurvem_pFalloffCurve
 
AttributeCheckableFloatArray m_aFalloffBasedonFacingAngle
 
aevent m_cReset
 
PatchParameters m_cPatchParameters
 
Modifier m_eModifier
 
TriggerType m_eTriggerType
 
float m_fBrushSizeScale
 
float m_fBrushStrengthScale
 
BrushConfigurationm_pActiveConfiguration
 
BrushBehavior m_cAlternateBehavior1
 
BrushBehavior m_cAlternateBehavior2
 
acheckablefloat m_fSnapToCurve
 
bool m_bStrokeInterrupted
 
abool m_bConstrainToSurface
 
aenum m_iFalloffType
 

Additional Inherited Members

- Public Attributes inherited from Node
AttributeThisPointer m_pThis
 
 DECLARE_CLASS
 

Member Enumeration Documentation

Values for the falloff type property.

See also
SetFalloffType()
Enumerator
eFalloffHybrid 
eFalloffSurface 
eFalloffVolume 

Definition at line 274 of file brush.h.

enum Direction

Values for the brush direction property.

See also
Direction()
Enumerator
eDirNormal 
eDirAveragedNormal 
eDirVertexNormal 
eDirForward 
eDirRight 
eDirX 
eDirY 
eDirZ 
eDirCamera 
eDirScreen 
eDirXY 
eDirXZ 
eDirYZ 

Definition at line 282 of file brush.h.

enum Modifier

Values for the brush effect modifier.

Enumerator
eModNormal 
eModAdditive 
eModInverted 
eModNoEffect 

Definition at line 300 of file brush.h.

This value represents how the user triggered the brush.

Enumerator
eTriggerPrimary 
eTriggerSecondary 
eTriggerTertiary 

Definition at line 309 of file brush.h.

310  {
311  eTriggerPrimary, // primary button was used (by default left mouse button)
312  eTriggerSecondary, // secondary button was used (by default middle mouse button)
313  eTriggerTertiary // tertiary button was used (by default left+middle mouse button)
314  };
enum MaskType

Values for mask types that can be add to the brush effect as a multiplier.

Enumerator
eMaskAny 
eMaskStamp 
eMaskStencil 
eMaskTypeCount 

Definition at line 317 of file brush.h.

Values for stamp resizing mode.

Using and returning these values a brush can inform the kernel to draw and drag a stamp image during the stroke using the first and the current pick points.

Enumerator
eStampSizingNone 

No resizing at all.

eStampSizingRadius 

Stamp resized with the 2 points defining the radius (starting point is the center)

eStampSizingDiameter 

Stamp resized with the 2 points defining the diameter.

Definition at line 327 of file brush.h.

328  {
335  };
Stamp resized with the 2 points defining the diameter.
Definition: brush.h:334
Stamp resized with the 2 points defining the radius (starting point is the center) ...
Definition: brush.h:332

Constructor & Destructor Documentation

Constructor, do not use it directly.

Member Function Documentation

virtual QString StringID ( const ClassDesc pClass = 0) const
virtual

Returns the string id of the current brush operation.

Reimplemented from Node.

virtual QString DisplayName ( void  ) const
virtual

Returns the display name of the current brush operation.

Reimplemented from Node.

virtual void OnNodeEvent ( const Attribute cAttribute,
NodeEventType  eType 
)
virtual

Overriding the node event.

Reimplemented from Node.

virtual bool IsScreenSpace ( void  ) const
virtual

Returns if the brush is in screen space.

virtual float BrushSize ( void  ) const
virtual

Returns the size of the active brush.

virtual float BrushStrength ( void  ) const
virtual

Returns the strength of the active brush.

virtual void SetBrushSize ( float  fSize)
virtual

Sets the size of the active brush.

virtual void SetBrushStrength ( float  fStrength)
virtual

Sets the strength of the active brush.

virtual float EffectiveBrushSize ( void  ) const
virtual

Returns the size of the active brush including the scaling parameter.

virtual float EffectiveBrushStrength ( void  ) const
virtual

Returns the strength of the active brush including the scaling parameter.

virtual float BrushSizeBias ( void  ) const
virtual

Returns the size bias percentage.

virtual float BrushStrengthBias ( void  ) const
virtual

Returns the strength bias percentage.

virtual float MaxBrushSize ( void  ) const
virtual

Returns the maximal brush size.

virtual float MaxBrushStrength ( void  ) const
virtual

Returns the maximal brush strength.

virtual bool UsesStrokeSmoothing ( void  ) const
virtual

Returns true if the brush wants to use drawing curve.

virtual float StrokeSmoothingDistance ( void  ) const
virtual

Returns the distance parameter for smoothing if the brush uses drawing curve.

virtual void SetStrokeSmoothing ( bool  bEnable,
float  fDistance 
)
virtual

Convenience function for setting Stroke smoothing parameters.

virtual bool HasCustomCursor ( void  )
virtual

Returns true if the brush wants to draw the cursor on it's own.

virtual bool UsesSteadyStroke ( void  ) const
virtual

Returns true if the brush wants to use drawing curve.

virtual float SteadyStrokeDistance ( void  ) const
virtual

Returns the distance parameter for smoothing if the brush uses drawing curve.

virtual void SetSteadyStroke ( bool  bEnable,
float  fDistance 
)
virtual

Convenience function for setting Stroke smoothing parameters.

virtual enum StampSizingMode StampSizingMode ( void  ) const
virtual

Returns the current stamp sizing mode.

virtual void SetStampSizingMode ( enum StampSizingMode  eMode)
virtual

Sets the current stamp sizing mode.

virtual const NURBSCurve* Falloff ( void  ) const
virtual

Returns the falloff curve.

virtual void SetFalloff ( NURBSCurve pCurve)
virtual

Sets the falloff curve.

virtual const Store<float>& FalloffData ( void  ) const
virtual

Returns the current falloff table.

float FalloffValue ( float  fValue) const
inline

Returns the falloff value in the specified curve position.

Definition at line 429 of file brush.h.

430  {
431  return FalloffData()[int(fValue*(FalloffData().ItemCount()-1))];
432  };
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
Definition: GLee.h:10762
virtual const Store< float > & FalloffData(void) const
Returns the current falloff table.
virtual bool UsesFalloffBasedOnFacingAngle ( void  ) const
virtual

Returns true if Falloff based on Facing Angle is on.

virtual void SetFalloffBasedOnFacingAngle ( bool  bEnable)
virtual

Set Falloff based on Facing Angle.

void SetFalloffType ( FalloffType  eType)

Set falloff type.

See also
FalloffType
FalloffType GetFalloffType ( ) const

Returns the falloff type.

See also
FalloffType
virtual bool UsesStampRandomize ( void  ) const
virtual

Returns true if Stamp Randomize is on.

virtual void SetStampRandomize ( bool  bEnable)
virtual

Set Falloff based on Facing Angle.

virtual bool IsMaskEnabled ( MaskType  type = eMaskAny) const
virtual

Returns true if the mask is turned on for the brush.

virtual const Image* MaskImage ( MaskType  type = eMaskAny) const
virtual

Returns the current mask image.

virtual Matrix MaskMatrix ( MaskType  type = eMaskAny) const
virtual

Returns the current matrix of the mask.

virtual bool IsMaskInverted ( MaskType  type = eMaskAny) const
virtual

Returns whether the value should be inverted or not (inversion means 1-x)

virtual float MaskFactor ( MaskType  type = eMaskAny) const
virtual

Returns the factor value, which should be multiplied to the mask value.

virtual bool IsMaskTiled ( MaskType  type = eMaskAny) const
virtual

Returns true if the mask shall tile, and false if all the values outside the mask should be treated as zero.

virtual QString MaskName ( MaskType  type = eMaskAny) const
virtual

Returns a string identifier which is unique for this mask.

virtual bool MaskBuildUp ( MaskType  type = eMaskAny) const
virtual

Returns true if the mask should be included in buildup or not.

virtual const Image* MaskOpacityImage ( MaskType  type = eMaskAny) const
virtual

Returns the effective area of the mask as an image. Use this to restrict the mask effect to certain pixels.

virtual float MaskOffset ( MaskType  type = eMaskAny) const
virtual

Returns the offset of the mask.

virtual void OnMaskChanged ( MaskType  type = eMaskAny)
virtual

Called by the kernel when the active stamp or stencil is changed on the UI. Override if you want to be notified when this happens.

virtual float BuildUpRate ( void  ) const
virtual

Returns the current build up rate (between 0 and 1).

virtual bool PatchesAtRelease ( void  ) const
virtual

Returns if the patchs should be applied at the end of stroke.

virtual bool PressureControlsBrushSize ( void  ) const
virtual

Returns if the pressure affects brush size.

virtual bool PressureControlsBrushStrength ( void  ) const
virtual

Returns if the pressure affects brush strength.

virtual bool IsInverted ( void  ) const
virtual

Returns the mode if inverted or not.

virtual bool IsOrientedToSurface ( void  ) const
virtual

Returns if the brush is aligned to the surface.

virtual void SetOrientedToSurface ( bool  bOriented)
virtual

Sets if the brush is aligned to the surface.

virtual bool IsStrokeOnCurveEnabled ( void  ) const
virtual

Returns if the brush can be used as a tool for Stroke on curve function.

Direction Direction ( void  ) const

Returns the direction type.

virtual void SetDirectionVector ( const Vector vDirection) const
virtual

When the current direction is calculated properly, the operation may want to call this routine to use the direction for the stamp transformation.

Vector PreviousPatchPosition ( void  ) const

Return the local position of the previous patch in this stroke.

virtual void BeginStroke ( Mesh pMesh,
Modifier  eModifier,
TriggerType  eTriggerType 
)
virtual

Called when a new stroke is started.

virtual void EndStroke ( void  )
virtual

Called when a stroke is finished.

virtual void MouseMove ( float  fXPosition,
float  fYPosition,
float  fXDelta,
float  fYDelta,
AxisAlignedBoundingBox cDirtyWorldArea,
float  fPressure 
)
virtual

Called when the mouse is moved during a stroke. The default implementation calls AddPatch(). Positions are in range [0,1].

virtual void AddPatch ( const SurfacePoint pPoint,
const Vector vPatchCenter,
float  fSize,
float  fPressure,
float  fStrength,
AxisAlignedBoundingBox cDirtyWorldArea 
)
virtual

Called when a new surface point has to be added to the stroke.

virtual void Flood ( Mesh pTarget,
float  fStrength = 1.0f,
bool  bFromCamera = false 
)
virtual

Flood a mesh with the effect of the brush.

void SetPatchParameters ( const SurfacePoint pS,
float  fSize,
float  fStrength,
Vector  vMove 
)

Set the effective parameters at the time of adding a patch.

float EffectiveBrushSize ( void  )

Returns the size at patch time modified by pressure, stamp randomize and other possible factors.

float EffectiveBrushStrength ( void  )

Returns the strength at patch time modified by pressure, stamp randomize and other possible factors.

virtual void SetActiveConfiguration ( BrushConfiguration config)
virtual

Changes to the configuration.

virtual void SetActiveConfiguration ( const QString sName)
virtual

Changes to the configuration.

virtual BrushConfiguration* ActiveConfiguration ( void  ) const
virtual

Returns the active configuration.

virtual void ResetBrushConfiguration ( void  )
virtual

Reset the configuration to default.

static void AddConfiguration ( BrushConfiguration config)
static

Add a new configuration.

static unsigned int ConfigurationCount ( void  )
static

Returns the number of configurations.

static BrushConfiguration* Configuration ( unsigned int  iIndex)
static

Returns a configuration.

static void ClearConfigurations ( void  )
static

Clear out all brush configurations.

const StampConfiguration& StampConfig ( void  ) const

Returns the structure with stamp properties.

void SetStampConfig ( StampConfiguration newConfig)

Sets stamp configuration.

void SetStamp ( bool  bEnable,
const QString sFileName = "" 
)

Convenience method for enabling stamp and setting stamp image.

void SetBrushSizeScale ( float  fScale)

Set the scale amount of size according to the brush configuration.

void SetBrushStrengthScale ( float  fScale)

Set the scale amount of strength according to the brush configuration.

bool UsesGlobalBrushSize ( void  ) const

Returns if the brush uses the global size.

Modifier CurrentModifier ( void  ) const

Returns the current modifier of the brush.

This typically indicates if the user is pressing ctrl while making a brush stroke to invert the effect

const MirrorConfiguration& MirrorConfig ( void  ) const

Returns the mirror configuration.

virtual void SetMirrorConfig ( MirrorConfiguration  newConfig)
virtual

Sets mirror configuration.

virtual bool IsConfigurationInited ( BrushConfiguration config) const
virtual

Returns if we already initialized the configuration with the default values.

Can be used to check if the config is set for the first time so it needs some config-dependent initialization. The parameter is the configuration index defined in the config declaration.

virtual void StoreConfiguration ( BrushConfiguration config)
virtual

Saves the configuration state (the attribute values) into memory The parameter is the configuration index defined in the config declaration.

virtual void RestoreConfiguration ( BrushConfiguration config)
virtual

Reloads the configuration state from the saved buffer so it restores the same state when it was active last time.

The parameter is the configuration index defined in the config declaration.

static void SerializeConfigurationStates ( Stream s)
static

Saves/loads the current states of the brushes to/from the given stream.

virtual QString OverlayIcon ( void  )
virtual

Returns the file name to be displayed as an overlay icon above the cursor.

virtual QPointF OverlayOffset ( void  )
virtual

Returns an (x, y) offset relative to the mouse cursor where the icon should be displayed.

virtual bool ExecuteAndInvert ( void  )
virtual

For storing and restoring undo/redo data.

Reimplemented from Operation.

virtual void Serialize ( Stream s)
virtual

Serializing.

Reimplemented from Node.

virtual BrushOperation& operator= ( const BrushOperation op)
virtual

Value assignment operator.

virtual bool CanLockLayer ( void  ) const
virtual

Returns if using the brush will lock the active layer to the current subdivision level so it cannot be modified on other levels later.

virtual bool CustomPicker ( void  )
virtual

Brushes can implement their own picker and return true if they handle picking in their own.

Returning false would result the default process when clicking on a mesh.

virtual Node* AttributeHolderNode ( void  )
virtual

Returns the node that contains the displayed attribute list of the operation.

Mostly it is the operation itself but can return anything to allow custom attribute list.

virtual void SetFalloffIndex ( int  iIndex)
virtual

Internal use only.

virtual int FalloffIndex ( void  ) const
virtual

Internal use only.

virtual unsigned int AlternateBehaviorCount ( void  ) const
virtual

Returns the number of possible alternate behaviors for the brush.

virtual const BrushBehavior& AlternateBehavior ( unsigned int  iIndex) const
virtual

Returns the given alternate behavior instance.

virtual bool IsSnapToCurve ( void  ) const
virtual

Returns true if snap mouse to active curve.

virtual float SnapDistance ( void  ) const
virtual

Returns the distance tolerance when snapping mouse to curves.

bool StrokeInterrupted ( void  ) const

Returns true if the stroke was interrupted, for example if the tool opened a window mid-stroke.

virtual bool ShowBrushInStroke ( void  ) const
virtual

Returns if the brush ring should be visible during the stroke.

virtual void SetConstrainToSurface ( bool  bCts)
virtual

Sets if the brush should keep the surface curvature.

virtual bool ConstrainToSurface ( ) const
virtual

Returns ture if the stroke keep the surface curvature.

Member Data Documentation

abool m_bScreenSpace
protected

ATTRIBUTES:

Definition at line 626 of file brush.h.

abool m_bInverted
protected

Definition at line 627 of file brush.h.

abool m_bOrientToSurface
protected

Definition at line 628 of file brush.h.

afloatr m_fNormalBrushSize
protected

Definition at line 629 of file brush.h.

afloatr m_fNormalBrushStrength
protected

Definition at line 629 of file brush.h.

afloatr m_fScreenBrushSize
protected

Definition at line 630 of file brush.h.

afloatr m_fScreenBrushStrength
protected

Definition at line 630 of file brush.h.

afloatr m_fMaxBrushSize
protected

Definition at line 631 of file brush.h.

afloatr m_fMaxBrushStrength
protected

Definition at line 631 of file brush.h.

afloatr m_fBrushSizeBias
protected

Definition at line 632 of file brush.h.

afloatr m_fBrushStrengthBias
protected

Definition at line 632 of file brush.h.

acheckablefloat m_fStrokeSmoothing
protected

Definition at line 633 of file brush.h.

acheckablefloat m_fSteadyStroke
protected

Definition at line 634 of file brush.h.

abool m_bRememberSize
protected

Definition at line 635 of file brush.h.

aenum m_iDirection
protected

Definition at line 636 of file brush.h.

astampcfg m_cStampCfg
protected

Definition at line 637 of file brush.h.

amirrorcfg m_cMirrorCfg
protected

Definition at line 638 of file brush.h.

aevent m_cFlood
protected

Definition at line 639 of file brush.h.

aevent m_cFloodFromCamera
protected

Definition at line 640 of file brush.h.

avoid m_vPressure
protected

Definition at line 641 of file brush.h.

acurveptr m_cFalloff
protected

Definition at line 642 of file brush.h.

aint m_iFalloffIndex
protected

Definition at line 643 of file brush.h.

aptr<NURBSCurve> m_pFalloffCurve
protected

Definition at line 644 of file brush.h.

AttributeCheckableFloatArray m_aFalloffBasedonFacingAngle
protected

Definition at line 645 of file brush.h.

aevent m_cReset
protected

Definition at line 646 of file brush.h.

PatchParameters m_cPatchParameters
protected

Definition at line 648 of file brush.h.

Modifier m_eModifier
protected

Definition at line 649 of file brush.h.

TriggerType m_eTriggerType
protected

Definition at line 650 of file brush.h.

float m_fBrushSizeScale
protected

Definition at line 651 of file brush.h.

float m_fBrushStrengthScale
protected

Definition at line 652 of file brush.h.

BrushConfiguration* m_pActiveConfiguration
protected

Definition at line 653 of file brush.h.

BrushBehavior m_cAlternateBehavior1
protected

Definition at line 655 of file brush.h.

BrushBehavior m_cAlternateBehavior2
protected

Definition at line 655 of file brush.h.

acheckablefloat m_fSnapToCurve
protected

Definition at line 657 of file brush.h.

bool m_bStrokeInterrupted
protected

Definition at line 659 of file brush.h.

abool m_bConstrainToSurface
protected

Definition at line 661 of file brush.h.

aenum m_iFalloffType
protected

Definition at line 663 of file brush.h.


The documentation for this class was generated from the following file: