VisuPlaneSet

VisuPlaneSet — Defines a storage object to gather VisuPlane objects.

Functions

Properties

guint hidding-mode Read / Write
gboolean masking Read / Write
guint n-planes Read

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── ToolDbgObj
        ╰── VisuPlaneSet

Implemented Interfaces

VisuPlaneSet implements VisuBoxed, VisuNodeMasker and VisuAnimatable.

Description

A VisuPlaneSet object is a storage object for a bunch of VisuPlane. This object provides methods to compute hiding properties, like visu_plane_set_getVisibility() ; method to load and save plane definitions into a file, see visu_plane_set_exportXMLFile() ; or to iterate over the internal storage.

Functions

VisuPlaneSetItemNew ()

gpointer
(*VisuPlaneSetItemNew) (VisuPlane *plane,
                        gpointer data);

A method to generate a new plane item in the plane set for plane . This method is called to encapsulate plane when plane is added to the plane set.

Parameters

plane

a VisuPlane object.

 

data

some user data.

 

Since: 3.8


VisuPlaneSetItemFree ()

void
(*VisuPlaneSetItemFree) (VisuPlane *plane,
                         gpointer data);

A method to free a given plane item in the plane set for plane . This method is called when plane is removed from the plane set.

Parameters

plane

a VisuPlane object.

 

data

some user data.

 

Since: 3.8


visu_plane_set_new ()

VisuPlaneSet *
visu_plane_set_new ();

Creates an object to store several planes and do hiding operations with them.

Returns

the newly created object.

[transfer full]

Since: 3.8


visu_plane_set_newFull ()

VisuPlaneSet *
visu_plane_set_newFull (VisuPlaneSetItemNew newItem,
                        VisuPlaneSetItemFree freeItem,
                        gpointer data);

Creates an object to store several planes and do hiding operations with them.

Parameters

newItem

a routine to be called when adding a plane to the set.

[scope call]

freeItem

a routine to be called when removing a plane from the set.

[scope call]

data

some user data.

 

Returns

.

[transfer full]

Since: 3.8


visu_plane_set_add ()

gboolean
visu_plane_set_add (VisuPlaneSet *set,
                    VisuPlane *plane);

Adds a plane to the list of stored planes.

Parameters

set

a VisuPlaneSet object.

 

plane

a VisuPlane object.

[transfer none]

Returns

FALSE if plane was already registered.

Since: 3.8


visu_plane_set_remove ()

gboolean
visu_plane_set_remove (VisuPlaneSet *set,
                       VisuPlane *plane);

Remove plane from the list of stored planes.

Parameters

set

a VisuPlaneSet object.

 

plane

a VisuPlane object.

 

Returns

TRUE if plane was found and removed.

Since: 3.8


visu_plane_set_getAt ()

VisuPlane *
visu_plane_set_getAt (const VisuPlaneSet *set,
                      guint i);

Retrieve the plane stored at index i .

Parameters

set

a VisuPlaneSet object.

 

i

an index.

 

Returns

a VisuPlane object or NULL index is out of bounds.

[transfer none][allow-none]

Since: 3.8


visu_plane_set_iter_new ()

gboolean
visu_plane_set_iter_new (const VisuPlaneSet *set,
                         VisuPlaneSetIter *iter);

Creates an iterator on the internal storage of VisuPlane objects.

Parameters

set

a VisuPlaneSet object.

 

iter

the iterator to create.

[out caller-allocates]

Returns

TRUE if iterator is valid (i.e. there are planes in set ).

Since: 3.8


visu_plane_set_iter_next ()

gboolean
visu_plane_set_iter_next (VisuPlaneSetIter *iter);

Use this function to iterate on plane stored in a VisuPlaneSet object.

Parameters

iter

an iterator.

 

Returns

TRUE if any plane remains.

Since: 3.8


visu_plane_set_getIntersection ()

gboolean
visu_plane_set_getIntersection (const VisuPlaneSet *set,
                                float pointA[3],
                                float pointB[3],
                                float inter[3],
                                gboolean inside);

Compute the location of the intersection point of segment AB with list of planes set . If there are several intersections, the closest to point A is returned. If inside is TRUE, then the intersection point must be within the line [AB].

Parameters

set

an array of VisuPlane, NULL terminated ;

 

pointA

three cartesian coordinates.

 

pointB

three cartesian coordinates.

 

inter

a location to store the intersection point.

 

inside

a boolean.

 

Returns

TRUE if there is an intersection.

Since: 3.8


visu_plane_set_setHiddingMode ()

gboolean
visu_plane_set_setHiddingMode (VisuPlaneSet *set,
                               VisuPlaneSetHiddingEnum mode);

This method is used to set the hiding mode flag. In union mode, elements are not drawn if they are hidden by one plane at least. In intersection mode, elements are only hidden if masked by all planes.

Parameters

set

the list of planes.

 

mode

a value related to the hiding mode (look at the enum VisuPlaneSetHiddingEnum).

 

Returns

TRUE if status changed.

Since: 3.8


visu_plane_set_getHiddingStatus ()

gboolean
visu_plane_set_getHiddingStatus (const VisuPlaneSet *set);

Inquire if the set has any masking planes.

Parameters

set

a VisuPlaneSet object.

 

Returns

TRUE if set has any masking planes.

Since: 3.8


visu_plane_set_getVisibility ()

gboolean
visu_plane_set_getVisibility (const VisuPlaneSet *set,
                              float point[3]);

Compute the visibility of the given point , following the masking scheme of the given plane list.

Parameters

set

a VisuPlaneSet object ;

 

point

three cartesian coordinates.

 

Returns

TRUE if the point is not masked.

Since: 3.8


visu_plane_set_parseXMLFile ()

gboolean
visu_plane_set_parseXMLFile (VisuPlaneSet *set,
                             const gchar *filename,
                             GError **error);

Read the given file (syntax in XML) and create a list of planes.

Parameters

set

a VisuPlaneSet object to store read planes.

 

filename

the file to parse ;.

[type filename]

error

a pointer to store the error (can be NULL).

 

Returns

TRUE if everything goes right, if not and error (if not NULL) is set and contains the message of the error.

Since: 3.8


visu_plane_set_exportXMLFile ()

gboolean
visu_plane_set_exportXMLFile (const VisuPlaneSet *set,
                              const gchar *filename,
                              GError **error);

Export in XML format the given list of planes to the given file.

Parameters

set

a VisuPlaneSet object.

 

filename

the file to export to ;

 

error

a pointer to store the error (can be NULL).

 

Returns

TRUE if everything goes right, if not and error (if not NULL) is set and contains the message of the error.

Since: 3.8

Types and Values

struct VisuPlaneSet

struct VisuPlaneSet;

Common name to refer to a _VisuPlaneSet.


struct VisuPlaneSetClass

struct VisuPlaneSetClass {
  VisuObjectClass parent;
};

Common name to refer to a _VisuPlaneSetClass.

Members

VisuObjectClass parent;

private.

 

struct VisuPlaneSetIter

struct VisuPlaneSetIter {
  const VisuPlaneSet *set;
  VisuPlane *plane;

  GList *next;
};

Structure to iterate over the stored plane of set .

Members

const VisuPlaneSet *set;

the VisuPlaneSet to iter on.

 

VisuPlane *plane;

the current VisuPlane.

 

GList *next;

internal index.

[element-type gpointer]

Since: 3.8


enum VisuPlaneSetHiddingEnum

Enum used to address different hiding modes. See visu_plane_set_setHiddingMode() for further details.

Members

VISU_PLANE_SET_HIDE_UNION

element are masked if one plane at least mask it ;

 

VISU_PLANE_SET_HIDE_INTER

element are masked if all planes mask it ;

 

VISU_PLANE_SET_HIDE_N_VALUES

number of masking possibilities.

 

Property Details

The “hidding-mode” property

  “hidding-mode”             guint

how to hide from multiple planes.

Flags: Read / Write

Allowed values: <= 1

Default value: 0


The “masking” property

  “masking”                  gboolean

masking property.

Flags: Read / Write

Default value: FALSE


The “n-planes” property

  “n-planes”                 guint

number of planes.

Flags: Read

Default value: 0

Signal Details

The “added” signal

void
user_function (VisuPlaneSet *set,
               VisuPlane    *plane,
               gpointer      user_data)

This signal is emitted each time a plane is added to the set.

Parameters

set

the object emitting the signal.

 

plane

the added VisuPlane object.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8


The “removed” signal

void
user_function (VisuPlaneSet *set,
               VisuPlane    *plane,
               gpointer      user_data)

This signal is emitted each time a plane is removed from the set.

Parameters

set

the object emitting the signal.

 

plane

the removed VisuPlane object.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8