Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Box3D Namespace Reference

Perspective line for 3D perspectives. More...

Classes

class  Line
 
class  PerspectiveLine
 
class  VanishingPoint
 
struct  VPDrag
 
struct  VPDragger
 

Enumerations

enum  Axis {
  X = 1 , Y = 2 , Z = 4 , XY = 3 ,
  XZ = 5 , YZ = 6 , XYZ = 7 , NONE = 0
}
 
enum  FrontOrRear { FRONT = 0 , REAR = 8 }
 
enum  VPState { VP_FINITE = 0 , VP_INFINITE }
 

Functions

std::pair< Axis, Axisget_remaining_axes (Axis axis)
 
Glib::ustring string_from_axes (Box3D::Axis axis)
 
int axis_to_int (Box3D::Axis axis)
 
Proj::Axis toProj (Box3D::Axis axis)
 
int face_to_int (unsigned int face_id)
 
std::pair< Box3D::Axis, Box3D::FrontOrRearint_to_face (unsigned id)
 
bool is_face_id (unsigned int face_id)
 
unsigned int number_of_axis_directions (Box3D::Axis axis)
 inline gint opposite_face (guint face_id) { return face_id + (((face_id % 2) == 0) ? 1 : -1); }
 
bool is_plane (Box3D::Axis plane)
 
bool is_single_axis_direction (Box3D::Axis dir)
 
Box3D::Axis third_axis_direction (Box3D::Axis dir1, Box3D::Axis dir2)
 Given two axis directions out of {X, Y, Z} or the corresponding plane, return the remaining one We don't check if 'plane' really specifies a plane (i.e., if it consists of precisely two directions).
 
Box3D::Axis third_axis_direction (Box3D::Axis plane)
 
Box3D::Axis extract_first_axis_direction (Box3D::Axis dirs)
 
Box3D::Axis extract_second_axis_direction (Box3D::Axis dirs)
 
Box3D::Axis orth_plane_or_axis (Box3D::Axis axis)
 
Box3D::Axis get_perpendicular_axis_direction (Box3D::Axis dirs)
 
std::pair< double, double > coordinates (Geom::Point const &v1, Geom::Point const &v2, Geom::Point const &w)
 
bool lies_in_sector (Geom::Point const &v1, Geom::Point const &v2, Geom::Point const &w)
 
bool lies_in_quadrangle (Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D, Geom::Point const &pt)
 
static double pos_angle (Geom::Point v, Geom::Point w)
 
std::pair< Geom::Point, Geom::Pointside_of_intersection (Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D, Geom::Point const &pt, Geom::Point const &dir)
 
double determinant (Geom::Point const &a, Geom::Point const &b)
 
std::ostream & operator<< (std::ostream &out_file, const Line &in_line)
 A function to print out the Line.
 
static void vp_drag_sel_changed (Inkscape::Selection *, gpointer data)
 
static void vp_drag_sel_modified (Inkscape::Selection *, guint, gpointer data)
 
static bool have_VPs_of_same_perspective (VPDragger *dr1, VPDragger *dr2)
 
static void vp_knot_moved_handler (SPKnot *knot, Geom::Point const &ppointer, guint state, gpointer data)
 
static void vp_knot_grabbed_handler (SPKnot *, unsigned int, gpointer data)
 
static void vp_knot_ungrabbed_handler (SPKnot *knot, guint, gpointer data)
 

Variables

Axis axes [3] = { X, Y, Z }
 
Axis planes [3] = { XY, XZ, YZ }
 
FrontOrRear face_positions [2] = { FRONT, REAR }
 
const double epsilon = 1e-6
 

Detailed Description

Perspective line for 3D perspectives.

Authors: Maximilian Albert Anhal.nosp@m.ter4.nosp@m.2@gmx.nosp@m..de

Copyright (C) 2007 authors

Released under GNU GPL v2+, read the file 'COPYING' for more information.

Enumeration Type Documentation

◆ Axis

Enumerator
XY 
XZ 
YZ 
XYZ 
NONE 

Definition at line 60 of file axis-manip.h.

◆ FrontOrRear

Enumerator
FRONT 
REAR 

Definition at line 73 of file axis-manip.h.

◆ VPState

Enumerator
VP_FINITE 
VP_INFINITE 

Definition at line 36 of file vanishing-point.h.

Function Documentation

◆ axis_to_int()

int Box3D::axis_to_int ( Box3D::Axis  axis)
inline

Definition at line 79 of file axis-manip.h.

References NONE, X, Y, and Z.

◆ coordinates()

std::pair< double, double > Box3D::coordinates ( Geom::Point const &  v1,
Geom::Point const &  v2,
Geom::Point const &  w 
)

Definition at line 79 of file line-geometry.cpp.

References det(), determinant(), epsilon, and w.

Referenced by lies_in_sector().

◆ determinant()

double Box3D::determinant ( Geom::Point const &  a,
Geom::Point const &  b 
)
inline

Definition at line 64 of file line-geometry.h.

References Geom::X, and Geom::Y.

Referenced by coordinates().

◆ extract_first_axis_direction()

Box3D::Axis Box3D::extract_first_axis_direction ( Box3D::Axis  dirs)
inline

◆ extract_second_axis_direction()

Box3D::Axis Box3D::extract_second_axis_direction ( Box3D::Axis  dirs)
inline

◆ face_to_int()

int Box3D::face_to_int ( unsigned int  face_id)
inline

Definition at line 149 of file axis-manip.h.

Referenced by box3d_get_sides().

◆ get_perpendicular_axis_direction()

Box3D::Axis Box3D::get_perpendicular_axis_direction ( Box3D::Axis  dirs)
inline

Definition at line 236 of file axis-manip.h.

References NONE, X, Y, and Z.

◆ get_remaining_axes()

std::pair< Axis, Axis > Box3D::get_remaining_axes ( Axis  axis)

◆ have_VPs_of_same_perspective()

static bool Box3D::have_VPs_of_same_perspective ( VPDragger dr1,
VPDragger dr2 
)
static

Definition at line 63 of file vanishing-point.cpp.

References Box3D::VPDragger::hasPerspective(), and Box3D::VPDragger::vps.

Referenced by vp_knot_moved_handler().

◆ int_to_face()

std::pair< Box3D::Axis, Box3D::FrontOrRear > Box3D::int_to_face ( unsigned  id)
inline

Definition at line 169 of file axis-manip.h.

References FRONT, NONE, REAR, XY, XZ, and YZ.

Referenced by box3d_swap_sides(), and Inkscape::UI::Tools::Box3dTool::drag().

◆ is_face_id()

bool Box3D::is_face_id ( unsigned int  face_id)
inline

Definition at line 181 of file axis-manip.h.

Referenced by Box3DSide::set().

◆ is_plane()

bool Box3D::is_plane ( Box3D::Axis  plane)
inline

Definition at line 200 of file axis-manip.h.

References number_of_axis_directions().

Referenced by Inkscape::UI::Tools::Box3dTool::drag(), and Box3DSide::set().

◆ is_single_axis_direction()

bool Box3D::is_single_axis_direction ( Box3D::Axis  dir)
inline

Definition at line 204 of file axis-manip.h.

Referenced by get_remaining_axes().

◆ lies_in_quadrangle()

bool Box3D::lies_in_quadrangle ( Geom::Point const &  A,
Geom::Point const &  B,
Geom::Point const &  C,
Geom::Point const &  D,
Geom::Point const &  pt 
)

Definition at line 104 of file line-geometry.cpp.

References D, and lies_in_sector().

◆ lies_in_sector()

bool Box3D::lies_in_sector ( Geom::Point const &  v1,
Geom::Point const &  v2,
Geom::Point const &  w 
)

◆ number_of_axis_directions()

unsigned int Box3D::number_of_axis_directions ( Box3D::Axis  axis)
inline

inline gint opposite_face (guint face_id) { return face_id + (((face_id % 2) == 0) ? 1 : -1); }

Definition at line 191 of file axis-manip.h.

References num, X, Y, and Z.

Referenced by is_plane().

◆ operator<<()

std::ostream & Box3D::operator<< ( std::ostream &  out_file,
const Line in_line 
)
inline

A function to print out the Line.

It just prints out the coordinates of start point and direction on the given output stream

Definition at line 77 of file line-geometry.h.

◆ orth_plane_or_axis()

Box3D::Axis Box3D::orth_plane_or_axis ( Box3D::Axis  axis)
inline

Definition at line 231 of file axis-manip.h.

References XYZ.

Referenced by Inkscape::UI::Tools::Box3dTool::drag(), get_remaining_axes(), and Box3DSide::set().

◆ pos_angle()

static double Box3D::pos_angle ( Geom::Point  v,
Geom::Point  w 
)
static

Definition at line 109 of file line-geometry.cpp.

References Geom::atan2(), and w.

Referenced by side_of_intersection().

◆ side_of_intersection()

std::pair< Geom::Point, Geom::Point > Box3D::side_of_intersection ( Geom::Point const &  A,
Geom::Point const &  B,
Geom::Point const &  C,
Geom::Point const &  D,
Geom::Point const &  pt,
Geom::Point const &  dir 
)

Definition at line 120 of file line-geometry.cpp.

References D, lies_in_sector(), pos_angle(), and result.

Referenced by Box3D::Line::intersection_with_viewbox().

◆ string_from_axes()

Glib::ustring Box3D::string_from_axes ( Box3D::Axis  axis)

Definition at line 36 of file axis-manip.cpp.

References result, X, Y, and Z.

Referenced by Box3DSide::axes_string().

◆ third_axis_direction() [1/2]

Box3D::Axis Box3D::third_axis_direction ( Box3D::Axis  dir1,
Box3D::Axis  dir2 
)
inline

Given two axis directions out of {X, Y, Z} or the corresponding plane, return the remaining one We don't check if 'plane' really specifies a plane (i.e., if it consists of precisely two directions).

Definition at line 213 of file axis-manip.h.

Referenced by box3d_side_compute_corner_ids().

◆ third_axis_direction() [2/2]

Box3D::Axis Box3D::third_axis_direction ( Box3D::Axis  plane)
inline

Definition at line 216 of file axis-manip.h.

◆ toProj()

Proj::Axis Box3D::toProj ( Box3D::Axis  axis)
inline

◆ vp_drag_sel_changed()

static void Box3D::vp_drag_sel_changed ( Inkscape::Selection ,
gpointer  data 
)
static

◆ vp_drag_sel_modified()

static void Box3D::vp_drag_sel_modified ( Inkscape::Selection ,
guint  ,
gpointer  data 
)
static

◆ vp_knot_grabbed_handler()

static void Box3D::vp_knot_grabbed_handler ( SPKnot ,
unsigned int  ,
gpointer  data 
)
static

Definition at line 196 of file vanishing-point.cpp.

References data, Box3D::VPDrag::dragging, and Box3D::VPDragger::parent.

Referenced by Box3D::VPDragger::VPDragger().

◆ vp_knot_moved_handler()

◆ vp_knot_ungrabbed_handler()

Variable Documentation

◆ axes

Axis Box3D::axes = { X, Y, Z }

Definition at line 25 of file axis-manip.cpp.

Referenced by box3d_exchange_coords(), and SPBox3D::recompute_z_orders().

◆ epsilon

const double Box3D::epsilon = 1e-6

Definition at line 56 of file axis-manip.h.

Referenced by coordinates(), and Box3D::Line::pts_coincide().

◆ face_positions

FrontOrRear Box3D::face_positions = { FRONT, REAR }

Definition at line 27 of file axis-manip.cpp.

◆ planes

Axis Box3D::planes = { XY, XZ, YZ }

Definition at line 26 of file axis-manip.cpp.