v_sim.Plane¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
rendering color  | 
||
r/w  | 
distance to origin  | 
||
r/w  | 
hidding property  | 
||
r/w  | 
normal vector  | 
||
r/w  | 
opacity property  | 
||
r/w  | 
rendering property  | 
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
This signal is emitted each time the plane position is changed (either distance or normal).  | 
|
This signal is emitted each time the rendering properties (color, visibility…) are affected.  | 
Fields¶
- Inherited:
 
Class Details¶
- class v_sim.Plane(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
All fields are private, use the access routines.
- classmethod getOrderedIntersections(nVisuPlanes, listOfVisuPlanes, pointA, pointB, inter, index)¶
 - Parameters:
 nVisuPlanes (
int) – the number of planes (must be consistent with the number of planes in listOfVisuPlanes!)listOfVisuPlanes (
v_sim.Plane) – an array ofv_sim.Plane,Noneterminated ;pointA (
float) – three cartesian coordinates.pointB (
float) – three cartesian coordinates.inter (
float) – a pointer to the location to store the intersection points. Supposing you know the number of intersection points !index (
int) – a pointer to the location to store the indices of ordering of the planes.
- Returns:
 Trueif the intersections are found.- Return type:
 
Compute the location of the intersection points of segment AB with list of planes listOfVisuPlanes. If there are several intersections, they are ordered by the proximity to point A.
- classmethod new(box, vect, dist, color)¶
 - Parameters:
 vect ([
float]) – three values defining the normal vector (unitary or not) ;dist (
float) – the distance between origin and intersection of the plane and the line made by origin and normal vector ;color (
v_sim.Color) – av_sim.Color.
- Returns:
 a newly allocated
v_sim.Planestructure.- Return type:
 
Create a plane with the specified attributes.
- classmethod newUndefined()¶
 - Returns:
 a newly allocated
v_sim.Planestructure.- Return type:
 
Create a new plane with default values. This plane can’t be rendered directly and one needs to computes its intersection with the bounding box before using planeComputeInter().
- getBasis(xyz, center)¶
 - 
Stores the coordinates of barycentre of the plane in center and provide coordinates of two orthogonal vector in the plane. The planeComputeInter() should have been called before.
 
- getColor()¶
 - Returns:
 a
v_sim.Color.- Return type:
 
Stores the color of the plane.
- getDistanceFromOrigin()¶
 - Returns:
 a float value.
- Return type:
 
Stores the distance of the plane to the origin.
- getHiddenState()¶
 - Returns:
 the state, defined by
v_sim.PLANE_SIDE_PLUSorv_sim.PLANE_SIDE_MINUSorv_sim.PLANE_SIDE_NONE.- Return type:
 
The plane can hide the nodes on one of its side. this method get the status for the given self.
- getLineIntersection(A, B)¶
 - Parameters:
 - Returns:
 Trueif there is an intersection between line (AB) and the plane.- lambda_:
 a location to store the intersecting factor.
- Return type:
 
If there is an intersection M between line (AB) and self, then this function calculates M coordinates as M = A + lambda * AB.
New in version 3.6.
- getNVect(vect)¶
 - Parameters:
 vect (
float) – an already alloacted (size 3) float array.
Stores the coordinates of the normal vector in vect of the plane. It returns the normalized values.
- getNVectUser(vect)¶
 - Parameters:
 vect (
float) – an already alloacted (size 3) float array.
Stores the coordinates of the normal vector in vec of the plane. It returns the values given by the user, not the normalized vaues.
- getOpacity()¶
 - Returns:
 a float within [0;1].
- Return type:
 
Retrieves the plane opacity.
New in version 3.8.
- getPlaneIntersection(plane2)¶
 - Parameters:
 plane2 (
v_sim.Plane) – anotherv_sim.Planeobject.- Returns:
 Trueif there is an intersection between self and plane2.- A:
 the coordinates of the first point of intersection.
- B:
 the coordinates of the second point of intersection.
- Return type:
 
Calculates the intersection between self and plane2, if it exists. The intersection is returned in A and B as the coordinates of the two points on the border of self that intersect plane2.
New in version 3.7.
- getReducedIntersection(nVals)¶
 - Parameters:
 nVals (
int) – a location for an integer.- Returns:
 a newly allocated array of nVals * 2 values. Free it with
GLib.free().- Return type:
 
This routine returns the coordinates in the self basis set of its intersections with a box (see
v_sim.Boxed.setBox()). The coordinates are appended in the return array which length is stored in nVals.New in version 3.6.
- getRendered()¶
 - 
Get the visibility of a plane.
 
- getVisibility(point)¶
 - Parameters:
 point ([
float]) – some coordinates.- Returns:
 Trueif the given point is not masked by the self.- Return type:
 
Test the visibility of a given point with respect to the plane attributes.
New in version 3.8.
- setColor(color)¶
 - Parameters:
 color (
v_sim.Color) – av_sim.Color.- Returns:
 Trueif color changed.- Return type:
 
Change the color of the plane.
- setDistanceFromOrigin(dist)¶
 - Parameters:
 dist (
float) – the distance between origin and intersection of the plane and the line made by origin and normal vector.- Returns:
 1 if the intersections should be recalculated by a call to planeComputeInter(), 0 if not. Or -1 if there is an error.
- Return type:
 
Change the position of the plane.
- setHiddenState(side)¶
 - Parameters:
 side (
int) – a key,v_sim.PLANE_SIDE_NONE,v_sim.PLANE_SIDE_PLUSorv_sim.PLANE_SIDE_MINUS.- Returns:
 Trueif the hidding side was actually changed.- Return type:
 
The plane can hide the nodes on one of its side. The side argument can be
v_sim.PLANE_SIDE_PLUSorv_sim.PLANE_SIDE_MINUSorv_sim.PLANE_SIDE_NONE. It codes the side of the plane which hides the nodes. Ifv_sim.PLANE_SIDE_NONEis selected all nodes are rendered.
- setNormalVector(vect)¶
 - Parameters:
 vect ([
float]) – three values defining the normal vector (unitary or not).- Returns:
 1 if the intersections should be recalculated by a call to planeComputeInter(), 0 if not. Or -1 if there is an error.
- Return type:
 
Change the normal vector defining the orientation of the plane.
- setOpacity(opacity)¶
 - Parameters:
 opacity (
float) – a float in [0;1].- Returns:
 Trueif value is actually changed.- Return type:
 
Defines the plane opacity. Planes can be coloured with alpha channel colours. The opacity is an additional parameter that can be used to animate plane apparition for instance.
New in version 3.8.
Signal Details¶
- v_sim.Plane.signals.moved(plane)¶
 - Signal Name:
 moved- Flags:
 - Parameters:
 plane (
v_sim.Plane) – The object which received the signal
This signal is emitted each time the plane position is changed (either distance or normal).
New in version 3.3.
- v_sim.Plane.signals.rendering(plane)¶
 - Signal Name:
 rendering- Flags:
 - Parameters:
 plane (
v_sim.Plane) – The object which received the signal
This signal is emitted each time the rendering properties (color, visibility…) are affected.
New in version 3.7.
Property Details¶
- v_sim.Plane.props.color¶
 - Name:
 color- Type:
 - Default Value:
 - Flags:
 
rendering color
- v_sim.Plane.props.distance¶
 - 
distance to origin
 
- v_sim.Plane.props.hidding_side¶
 - 
hidding property
 
- v_sim.Plane.props.n_vector¶
 - 
normal vector
 
- v_sim.Plane.props.opacity¶
 - 
opacity property