A QPaintEngine that 'paints' the widgets by turning them into 3D Model objects.
More...
|
| | ScenePaintEngine (Model &scene) |
| | Constructs a scene paint engine rooted at the given model.
|
| Material | createCurrentMaterial (PrimitiveProperty property, bool is_text) |
| | Creates a new material for the given property type using current paint state.
|
| Material | currentMaterial (PrimitiveProperty property, bool is_text) |
| | Retrieves or creates the current material for the given property type.
|
| void | finishShape (bool is_solid) |
| | Finalizes the current shape model after geometry creation.
|
| Matrix< fltp08 > | getTransform (bool is_text) const |
| | Computes the current transform matrix for painting.
|
| bool | hasOutline () const |
| | Checks whether the current paint state has an outline pen.
|
| bool | hasSolid () const |
| | Checks whether the current paint state has a solid brush.
|
| bool | isFlat () const |
| | Checks whether the engine is in flat (2D) mode.
|
|
void | popModel () |
| | Pops the current model from the model stack, returning to the parent.
|
|
void | pushModel () |
| | Pushes a new child model onto the model stack for nested painting.
|
|
void | resetExtraDepth () |
| | Resets the extra depth counter used for z-ordering painted elements.
|
| void | setCurrentName (const String ¤t_name) |
| | Sets the current name used for naming new child models.
|
| void | setIsFlat (bool is_flat) |
| | Sets whether the output should be flat (2D) or hierarchical.
|
| void | setRoot (Model &new_root) |
| | Sets the root model for the paint engine.
|
| void | setupShapeModel (Model &model, bool has_solid=true, bool is_text=false) |
| | Sets up a model for a painted shape with appropriate materials.
|
| void | updateClipping (Model &model) |
| | Updates the clipping region for the given model.
|
|
| static void | AutoWidgetsToPDF (File file, WidgetIterator reports, QSize size=QSize(), bool send_file=false) |
| | Converts widget reports to a PDF file and optionally sends the file.
|
| static void | ModelsToPDF (const File &file, DesignObjectLookup &lookup, const Buffer< UUID > &camera_ids, fltp08 dpi, fltp04 margins=20.0f) |
| | Renders 3D model views to a PDF file.
|
| static void | PrepareWidgetsToModel (const Buffer< QWidget * > &widgets, QSize size=QSize()) |
| | Prepares widgets for model conversion by resizing and laying out.
|
| static Buffer< UUID > | PrepareWidgetsViews (DesignObjectLookup &lookup, const Buffer< QWidget * > &widgets, QSize size=QSize()) |
| | Prepares camera views from widgets for rendering.
|
| static Buffer< UUID > | PrepareWidgetsViews (DesignObjectLookup &lookup, const WidgetIterator &reports, QSize size=QSize()) |
| | Prepares camera views from widget reports for rendering.
|
| static QPalette | ScenePalette () |
| | Retrieves the palette used for scene painting.
|
| static PaintEngineFeatures | SceneRenderFeatures () |
| | Retrieves the supported paint engine features for scene rendering.
|
| static QStyle * | SceneStyle () |
| | Retrieves the style used for scene painting.
|
| static Buffer< QSize > | WidgetsToModel (const WidgetIterator &reports, Model &model, QSize size=QSize(), bool is_flat=false) |
| | Converts widget reports into 3D model objects.
|
| static void | WidgetsToPDF (const File &file, const Buffer< QWidget * > &widgets, QSize size=QSize()) |
| | Renders widgets directly to a PDF file.
|
|
|
String | m_current_image |
| | The current image resource identifier being drawn.
|
|
uint04 | m_extra_depth = 0 |
| | Extra depth offset for z-ordering painted elements.
|
|
uint04 | m_geometry_depth = 0 |
| | The current geometry depth in the hierarchy.
|
|
bool | m_is_clipping |
| | Whether clipping is currently active.
|
|
bool | m_is_flat = false |
| | Whether the engine is in flat (2D) mode.
|
|
Dictionary< UUID, Material > | m_materials |
| | Cache of materials created during painting.
|
|
Buffer< Model > | m_models |
| | Stack of models for nested painting.
|
|
Model | m_root |
| | The root model of the paint hierarchy.
|
A QPaintEngine that 'paints' the widgets by turning them into 3D Model objects.
Definition at line 95 of file ScenePaintEngine.h.
◆ ScenePaintEngine()
| ScenePaintEngine::ScenePaintEngine |
( |
Model & | scene | ) |
|
|
explicit |
Constructs a scene paint engine rooted at the given model.
- Parameters
-
| [in] | scene | The root model for the paint hierarchy. |
◆ AutoWidgetsToPDF()
| void ScenePaintEngine::AutoWidgetsToPDF |
( |
File | file, |
|
|
WidgetIterator | reports, |
|
|
QSize | size = QSize(), |
|
|
bool | send_file = false ) |
|
static |
Converts widget reports to a PDF file and optionally sends the file.
- Parameters
-
| [in] | file | The output PDF file path. |
| [in] | reports | The widget iterator providing report pages. |
| [in] | size | The page size, or default if empty. |
| [in] | send_file | Whether to open or send the file after creation. |
◆ createCurrentMaterial()
Creates a new material for the given property type using current paint state.
- Parameters
-
| [in] | property | The primitive property (solid or outline). |
| [in] | is_text | Whether the material is for text. |
- Returns
- The newly created Material.
◆ currentMaterial()
Retrieves or creates the current material for the given property type.
- Parameters
-
| [in] | property | The primitive property (solid or outline). |
| [in] | is_text | Whether the material is for text. |
- Returns
- The current Material.
◆ finishShape()
| void ScenePaintEngine::finishShape |
( |
bool | is_solid | ) |
|
Finalizes the current shape model after geometry creation.
- Parameters
-
| [in] | is_solid | Whether the shape has solid fill. |
◆ getTransform()
| Matrix< fltp08 > ScenePaintEngine::getTransform |
( |
bool | is_text | ) |
const |
Computes the current transform matrix for painting.
- Parameters
-
| [in] | is_text | Whether the transform is for text rendering. |
- Returns
- The current transform matrix.
Referenced by resetExtraDepth(), and SceneStyle().
◆ hasOutline()
| bool ScenePaintEngine::hasOutline |
( |
| ) |
const |
|
nodiscard |
Checks whether the current paint state has an outline pen.
- Returns
- True if an outline is active.
◆ hasSolid()
| bool ScenePaintEngine::hasSolid |
( |
| ) |
const |
|
nodiscard |
Checks whether the current paint state has a solid brush.
- Returns
- True if a solid fill is active.
◆ isFlat()
| bool ScenePaintEngine::isFlat |
( |
| ) |
const |
|
inline |
◆ ModelsToPDF()
Renders 3D model views to a PDF file.
- Parameters
-
| [in] | file | The output PDF file path. |
| [in] | lookup | The design object lookup. |
| [in] | camera_ids | The camera UUIDs to capture. |
| [in] | dpi | The DPI resolution for the output. |
| [in] | margins | The page margins in points. |
◆ PrepareWidgetsToModel()
| void ScenePaintEngine::PrepareWidgetsToModel |
( |
const Buffer< QWidget * > & | widgets, |
|
|
QSize | size = QSize() ) |
|
static |
Prepares widgets for model conversion by resizing and laying out.
- Parameters
-
| [in] | widgets | The widgets to prepare. |
| [in] | size | The target size, or default if empty. |
◆ PrepareWidgetsViews() [1/2]
Prepares camera views from widgets for rendering.
- Parameters
-
| [in] | lookup | The design object lookup for creating objects. |
| [in] | widgets | The widgets to convert. |
| [in] | size | The page size, or default if empty. |
- Returns
- A buffer of camera UUIDs for the prepared views.
◆ PrepareWidgetsViews() [2/2]
Prepares camera views from widget reports for rendering.
- Parameters
-
| [in] | lookup | The design object lookup for creating objects. |
| [in] | reports | The widget iterator providing report pages. |
| [in] | size | The page size, or default if empty. |
- Returns
- A buffer of camera UUIDs for the prepared views.
◆ ScenePalette()
| QPalette ScenePaintEngine::ScenePalette |
( |
| ) |
|
|
static |
Retrieves the palette used for scene painting.
- Returns
- The QPalette for scene widgets.
◆ SceneRenderFeatures()
| PaintEngineFeatures ScenePaintEngine::SceneRenderFeatures |
( |
| ) |
|
|
static |
Retrieves the supported paint engine features for scene rendering.
- Returns
- The set of supported PaintEngineFeatures.
◆ SceneStyle()
| QStyle * ScenePaintEngine::SceneStyle |
( |
| ) |
|
|
static |
◆ setCurrentName()
| void ScenePaintEngine::setCurrentName |
( |
const String & | current_name | ) |
|
Sets the current name used for naming new child models.
- Parameters
-
| [in] | current_name | The name to use. |
◆ setIsFlat()
| void ScenePaintEngine::setIsFlat |
( |
bool | is_flat | ) |
|
|
inline |
Sets whether the output should be flat (2D) or hierarchical.
- Parameters
-
| [in] | is_flat | Whether to use flat mode. |
Definition at line 442 of file ScenePaintEngine.h.
References m_is_flat.
◆ setRoot()
| void ScenePaintEngine::setRoot |
( |
Model & | new_root | ) |
|
Sets the root model for the paint engine.
- Parameters
-
| [in] | new_root | The new root model. |
◆ setupShapeModel()
| void ScenePaintEngine::setupShapeModel |
( |
Model & | model, |
|
|
bool | has_solid = true, |
|
|
bool | is_text = false ) |
Sets up a model for a painted shape with appropriate materials.
- Parameters
-
| [in] | model | The model to configure. |
| [in] | has_solid | Whether the shape has solid fill. |
| [in] | is_text | Whether the shape is text. |
Referenced by resetExtraDepth(), and SceneStyle().
◆ updateClipping()
| void ScenePaintEngine::updateClipping |
( |
Model & | model | ) |
|
Updates the clipping region for the given model.
- Parameters
-
| [in] | model | The model to update clipping for. |
◆ WidgetsToModel()
| Buffer< QSize > ScenePaintEngine::WidgetsToModel |
( |
const WidgetIterator & | reports, |
|
|
Model & | model, |
|
|
QSize | size = QSize(), |
|
|
bool | is_flat = false ) |
|
static |
Converts widget reports into 3D model objects.
- Parameters
-
| [in] | reports | The widget iterator providing report pages. |
| [in] | model | The root model to add the widget models under. |
| [in] | size | The page size, or default if empty. |
| [in] | is_flat | Whether to flatten the model hierarchy. |
- Returns
- A buffer of sizes for each generated page.
◆ WidgetsToPDF()
| void ScenePaintEngine::WidgetsToPDF |
( |
const File & | file, |
|
|
const Buffer< QWidget * > & | widgets, |
|
|
QSize | size = QSize() ) |
|
static |
Renders widgets directly to a PDF file.
- Parameters
-
| [in] | file | The output PDF file path. |
| [in] | widgets | The widgets to render. |
| [in] | size | The page size, or default if empty. |
The documentation for this class was generated from the following file: