Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Aspect_GridParams Class Reference

Shader grid appearance (color, scale, bounds, arc, draw mode, background / adaptive flags). Consumed only by the GPU path: V3d_View::GridDisplay -> OpenGl_View::renderGrid. No effect on the CPU path (V3d_Viewer::ActivateGrid). Snap math is independent and lives on Aspect_RectangularGrid / Aspect_CircularGrid. More...

#include <Aspect_GridParams.hxx>

Public Member Functions

 Aspect_GridParams ()
 Construct with sensible defaults: grey lines on the plane origin with axis coloring enabled, 1/100 plane-unit spacing, overlay mode, unbounded in extent and radius.
 
const Quantity_ColorColor () const
 Return grid line color.
 
void SetColor (const Quantity_Color &theColor)
 Set grid line color.
 
const gp_PntOrigin () const
 Return local offset of the grid origin within the plane.
 
void SetOrigin (const gp_Pnt &theOrigin)
 Set local offset of the grid origin within the plane.
 
const Quantity_ColorAccentColor () const
 Return every-tenth-line / accent colour rendered by the shader.
 
void SetAccentColor (const Quantity_Color &theColor)
 Set every-tenth-line / accent colour rendered by the shader.
 
double AccentScaleX () const
 Return accent overlay scale along the plane X/radial direction. Zero disables the accent layer on that axis.
 
void SetAccentScaleX (const double theScale)
 Set accent overlay scale along the plane X/radial direction.
 
double AccentScaleY () const
 Return accent overlay scale along the plane Y direction. Zero disables the accent layer on that axis.
 
void SetAccentScaleY (const double theScale)
 Set accent overlay scale along the plane Y direction.
 
double AccentAngularScale () const
 Return accent overlay angular scale for circular-grid spokes. Zero disables the angular accent layer.
 
void SetAccentAngularScale (const double theScale)
 Set accent overlay angular scale for circular-grid spokes.
 
double Scale () const
 Return major-grid scale factor along the plane X direction (cells per plane unit).
 
void SetScale (const double theScale)
 Set major-grid scale factor along the plane X direction (cells per plane unit). Must be non-negative; zero is a valid "unused" sentinel.
 
double ScaleY () const
 Return explicit Y-direction scale. When 0.0, renderer falls back to Scale() (isotropic).
 
void SetScaleY (const double theScaleY)
 Set explicit Y-direction scale. Pass 0.0 to mirror Scale() (isotropic, default).
 
double EffectiveScaleY () const
 Effective Y-direction scale actually consumed by the renderer.
 
double LineThickness () const
 Return line thickness in plane units (minimum pixel-space line width is derived from fwidth).
 
void SetLineThickness (const double theThickness)
 Set line thickness in plane units.
 
double RotationAngle () const
 Return in-plane rotation angle (radians) applied to the grid axes around the plane normal.
 
void SetRotationAngle (const double theAngle)
 Set in-plane rotation angle (radians) applied to the grid axes around the plane normal.
 
int AngularDivisions () const
 Return the angular subdivision count of the half-circle for circular grids. Zero means rectangular grid (default); any positive value switches the renderer to polar rings (Scale -> radial step) and spokes at pi/N rad.
 
void SetAngularDivisions (const int theDivisions)
 Set angular subdivision count (0 = rectangular grid, N>0 = circular with N spokes per 180 deg).
 
bool IsCircular () const
 Return TRUE when the parameters describe a circular (polar) grid.
 
double SizeX () const
 Return rectangular bounded extent along plane X; 0.0 means unbounded.
 
void SetSizeX (const double theSize)
 Set rectangular bounded extent along plane X; 0.0 means unbounded.
 
double SizeY () const
 Return rectangular bounded extent along plane Y; 0.0 means unbounded.
 
void SetSizeY (const double theSize)
 Set rectangular bounded extent along plane Y; 0.0 means unbounded.
 
double Radius () const
 Return circular bounded radius; 0.0 means unbounded.
 
void SetRadius (const double theRadius)
 Set circular bounded radius; 0.0 means unbounded.
 
double ZOffset () const
 Return signed plane-normal offset applied at render time.
 
void SetZOffset (const double theOffset)
 Set signed plane-normal offset applied at render time (display only; snap math stays on the unshifted plane).
 
double AngleStart () const
 Return arc start angle (radians). Meaningful only when IsArc() is true.
 
double AngleEnd () const
 Return arc end angle (radians). Meaningful only when IsArc() is true.
 
void SetArcRange (const double theStart, const double theEnd)
 Restrict the circular grid to an angular wedge [start, end], walking CCW. Equal start and end (e.g. 0.0 and 0.0) returns to full-circle rendering.
 
bool IsBounded () const
 Return TRUE when the parameters describe a bounded rectangle or disc.
 
bool IsArc () const
 Return TRUE when the circular grid is restricted to a sub-arc.
 
Aspect_GridDrawMode DrawMode () const
 Return draw mode: lines, points at grid intersections, or none.
 
void SetDrawMode (const Aspect_GridDrawMode theMode)
 Set draw mode. Aspect_GDM_None suppresses rendering entirely; Points draws dots at grid-line intersections, Lines (default) draws the full grid.
 
bool IsBackground () const
 Return TRUE if grid is drawn as a view-space background (behind all geometry).
 
void SetIsBackground (const bool theIsBackground)
 Set background-mode rendering on/off.
 
bool IsDrawAxis () const
 Return TRUE if axis lines on the grid plane are drawn in red/green/blue.
 
void SetIsDrawAxis (const bool theIsDrawAxis)
 Set axis coloring on/off.
 
bool IsViewAdaptive () const
 Return TRUE if grid spacing and visible extents adapt to the camera view.
 
void SetIsViewAdaptive (const bool theIsViewAdaptive)
 Set view-adaptive grid on/off. When enabled, renderer derives temporary cell spacing and bounds from the current camera. The inverse of ScaleY() (or Scale() when ScaleY() is zero) is used as the target number of cells across the view height.
 

Detailed Description

Shader grid appearance (color, scale, bounds, arc, draw mode, background / adaptive flags). Consumed only by the GPU path: V3d_View::GridDisplay -> OpenGl_View::renderGrid. No effect on the CPU path (V3d_Viewer::ActivateGrid). Snap math is independent and lives on Aspect_RectangularGrid / Aspect_CircularGrid.

Constructor & Destructor Documentation

◆ Aspect_GridParams()

Aspect_GridParams::Aspect_GridParams ( )
inline

Construct with sensible defaults: grey lines on the plane origin with axis coloring enabled, 1/100 plane-unit spacing, overlay mode, unbounded in extent and radius.

Member Function Documentation

◆ AccentAngularScale()

double Aspect_GridParams::AccentAngularScale ( ) const
inline

Return accent overlay angular scale for circular-grid spokes. Zero disables the angular accent layer.

◆ AccentColor()

const Quantity_Color & Aspect_GridParams::AccentColor ( ) const
inline

Return every-tenth-line / accent colour rendered by the shader.

◆ AccentScaleX()

double Aspect_GridParams::AccentScaleX ( ) const
inline

Return accent overlay scale along the plane X/radial direction. Zero disables the accent layer on that axis.

◆ AccentScaleY()

double Aspect_GridParams::AccentScaleY ( ) const
inline

Return accent overlay scale along the plane Y direction. Zero disables the accent layer on that axis.

◆ AngleEnd()

double Aspect_GridParams::AngleEnd ( ) const
inline

Return arc end angle (radians). Meaningful only when IsArc() is true.

◆ AngleStart()

double Aspect_GridParams::AngleStart ( ) const
inline

Return arc start angle (radians). Meaningful only when IsArc() is true.

◆ AngularDivisions()

int Aspect_GridParams::AngularDivisions ( ) const
inline

Return the angular subdivision count of the half-circle for circular grids. Zero means rectangular grid (default); any positive value switches the renderer to polar rings (Scale -> radial step) and spokes at pi/N rad.

◆ Color()

const Quantity_Color & Aspect_GridParams::Color ( ) const
inline

Return grid line color.

◆ DrawMode()

Aspect_GridDrawMode Aspect_GridParams::DrawMode ( ) const
inline

Return draw mode: lines, points at grid intersections, or none.

◆ EffectiveScaleY()

double Aspect_GridParams::EffectiveScaleY ( ) const
inline

Effective Y-direction scale actually consumed by the renderer.

◆ IsArc()

bool Aspect_GridParams::IsArc ( ) const
inline

Return TRUE when the circular grid is restricted to a sub-arc.

◆ IsBackground()

bool Aspect_GridParams::IsBackground ( ) const
inline

Return TRUE if grid is drawn as a view-space background (behind all geometry).

◆ IsBounded()

bool Aspect_GridParams::IsBounded ( ) const
inline

Return TRUE when the parameters describe a bounded rectangle or disc.

◆ IsCircular()

bool Aspect_GridParams::IsCircular ( ) const
inline

Return TRUE when the parameters describe a circular (polar) grid.

◆ IsDrawAxis()

bool Aspect_GridParams::IsDrawAxis ( ) const
inline

Return TRUE if axis lines on the grid plane are drawn in red/green/blue.

◆ IsViewAdaptive()

bool Aspect_GridParams::IsViewAdaptive ( ) const
inline

Return TRUE if grid spacing and visible extents adapt to the camera view.

◆ LineThickness()

double Aspect_GridParams::LineThickness ( ) const
inline

Return line thickness in plane units (minimum pixel-space line width is derived from fwidth).

◆ Origin()

const gp_Pnt & Aspect_GridParams::Origin ( ) const
inline

Return local offset of the grid origin within the plane.

◆ Radius()

double Aspect_GridParams::Radius ( ) const
inline

Return circular bounded radius; 0.0 means unbounded.

◆ RotationAngle()

double Aspect_GridParams::RotationAngle ( ) const
inline

Return in-plane rotation angle (radians) applied to the grid axes around the plane normal.

◆ Scale()

double Aspect_GridParams::Scale ( ) const
inline

Return major-grid scale factor along the plane X direction (cells per plane unit).

◆ ScaleY()

double Aspect_GridParams::ScaleY ( ) const
inline

Return explicit Y-direction scale. When 0.0, renderer falls back to Scale() (isotropic).

◆ SetAccentAngularScale()

void Aspect_GridParams::SetAccentAngularScale ( const double theScale)
inline

Set accent overlay angular scale for circular-grid spokes.

◆ SetAccentColor()

void Aspect_GridParams::SetAccentColor ( const Quantity_Color & theColor)
inline

Set every-tenth-line / accent colour rendered by the shader.

◆ SetAccentScaleX()

void Aspect_GridParams::SetAccentScaleX ( const double theScale)
inline

Set accent overlay scale along the plane X/radial direction.

◆ SetAccentScaleY()

void Aspect_GridParams::SetAccentScaleY ( const double theScale)
inline

Set accent overlay scale along the plane Y direction.

◆ SetAngularDivisions()

void Aspect_GridParams::SetAngularDivisions ( const int theDivisions)
inline

Set angular subdivision count (0 = rectangular grid, N>0 = circular with N spokes per 180 deg).

◆ SetArcRange()

void Aspect_GridParams::SetArcRange ( const double theStart,
const double theEnd )
inline

Restrict the circular grid to an angular wedge [start, end], walking CCW. Equal start and end (e.g. 0.0 and 0.0) returns to full-circle rendering.

◆ SetColor()

void Aspect_GridParams::SetColor ( const Quantity_Color & theColor)
inline

Set grid line color.

◆ SetDrawMode()

void Aspect_GridParams::SetDrawMode ( const Aspect_GridDrawMode theMode)
inline

Set draw mode. Aspect_GDM_None suppresses rendering entirely; Points draws dots at grid-line intersections, Lines (default) draws the full grid.

◆ SetIsBackground()

void Aspect_GridParams::SetIsBackground ( const bool theIsBackground)
inline

Set background-mode rendering on/off.

◆ SetIsDrawAxis()

void Aspect_GridParams::SetIsDrawAxis ( const bool theIsDrawAxis)
inline

Set axis coloring on/off.

◆ SetIsViewAdaptive()

void Aspect_GridParams::SetIsViewAdaptive ( const bool theIsViewAdaptive)
inline

Set view-adaptive grid on/off. When enabled, renderer derives temporary cell spacing and bounds from the current camera. The inverse of ScaleY() (or Scale() when ScaleY() is zero) is used as the target number of cells across the view height.

◆ SetLineThickness()

void Aspect_GridParams::SetLineThickness ( const double theThickness)
inline

Set line thickness in plane units.

◆ SetOrigin()

void Aspect_GridParams::SetOrigin ( const gp_Pnt & theOrigin)
inline

Set local offset of the grid origin within the plane.

◆ SetRadius()

void Aspect_GridParams::SetRadius ( const double theRadius)
inline

Set circular bounded radius; 0.0 means unbounded.

◆ SetRotationAngle()

void Aspect_GridParams::SetRotationAngle ( const double theAngle)
inline

Set in-plane rotation angle (radians) applied to the grid axes around the plane normal.

◆ SetScale()

void Aspect_GridParams::SetScale ( const double theScale)
inline

Set major-grid scale factor along the plane X direction (cells per plane unit). Must be non-negative; zero is a valid "unused" sentinel.

◆ SetScaleY()

void Aspect_GridParams::SetScaleY ( const double theScaleY)
inline

Set explicit Y-direction scale. Pass 0.0 to mirror Scale() (isotropic, default).

◆ SetSizeX()

void Aspect_GridParams::SetSizeX ( const double theSize)
inline

Set rectangular bounded extent along plane X; 0.0 means unbounded.

◆ SetSizeY()

void Aspect_GridParams::SetSizeY ( const double theSize)
inline

Set rectangular bounded extent along plane Y; 0.0 means unbounded.

◆ SetZOffset()

void Aspect_GridParams::SetZOffset ( const double theOffset)
inline

Set signed plane-normal offset applied at render time (display only; snap math stays on the unshifted plane).

◆ SizeX()

double Aspect_GridParams::SizeX ( ) const
inline

Return rectangular bounded extent along plane X; 0.0 means unbounded.

◆ SizeY()

double Aspect_GridParams::SizeY ( ) const
inline

Return rectangular bounded extent along plane Y; 0.0 means unbounded.

◆ ZOffset()

double Aspect_GridParams::ZOffset ( ) const
inline

Return signed plane-normal offset applied at render time.


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