Blender V2.61 - r43446
Defines | Functions | Variables

transform_manipulator.c File Reference

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
#include "RNA_access.h"
#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
#include "BIF_gl.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_mesh.h"
#include "ED_particle.h"
#include "ED_view3d.h"
#include "UI_resources.h"
#include "transform.h"

Go to the source code of this file.

Defines

#define MAN_TRANS_X   1
#define MAN_TRANS_Y   2
#define MAN_TRANS_Z   4
#define MAN_TRANS_C   7
#define MAN_ROT_X   8
#define MAN_ROT_Y   16
#define MAN_ROT_Z   32
#define MAN_ROT_V   64
#define MAN_ROT_T   128
#define MAN_ROT_C   248
#define MAN_SCALE_X   256
#define MAN_SCALE_Y   512
#define MAN_SCALE_Z   1024
#define MAN_SCALE_C   1792
#define MAN_RGB   0
#define MAN_GHOST   1
#define MAN_MOVECOL   2

Functions

static void calc_tw_center (Scene *scene, float *co)
static void protectflag_to_drawflags (short protectflag, short *drawflags)
static void stats_pose (Scene *scene, RegionView3D *rv3d, bPoseChannel *pchan)
static void stats_editbone (RegionView3D *rv3d, EditBone *ebo)
static void axis_angle_to_gimbal_axis (float gmat[3][3], float axis[3], float angle)
static int test_rotmode_euler (short rotmode)
int gimbal_axis (Object *ob, float gmat[][3])
int calc_manipulator_stats (const bContext *C)
static void test_manipulator_axis (const bContext *C)
static float screen_aligned (RegionView3D *rv3d, float mat[][4])
static void partial_donut (float radring, float radhole, int start, int end, int nsides, int nrings)
static char axisBlendAngle (float angle)
static void manipulator_setcolor (View3D *v3d, char axis, int colcode, unsigned char alpha)
static void draw_manipulator_axes (View3D *v3d, RegionView3D *rv3d, int colcode, int flagx, int flagy, int flagz)
static void preOrthoFront (int ortho, float twmat[][4], int axis)
static void postOrtho (int ortho)
static void draw_manipulator_rotate (View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo)
static void drawsolidcube (float size)
static void draw_manipulator_scale (View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode)
static void draw_cone (GLUquadricObj *qobj, float len, float width)
static void draw_cylinder (GLUquadricObj *qobj, float len, float width)
static void draw_manipulator_translate (View3D *v3d, RegionView3D *rv3d, int UNUSED(moving), int drawflags, int combo, int colcode)
static void draw_manipulator_rotate_cyl (View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode)
void BIF_draw_manipulator (const bContext *C)
static int manipulator_selectbuf (ScrArea *sa, ARegion *ar, const int mval[2], float hotspot)
int BIF_do_manipulator (bContext *C, struct wmEvent *event, wmOperator *op)

Variables

static int drawflags = 0xFFFF

Detailed Description

Definition in file transform_manipulator.c.


Define Documentation

#define MAN_GHOST   1

Definition at line 106 of file transform_manipulator.c.

Referenced by draw_manipulator_translate(), and manipulator_setcolor().

#define MAN_MOVECOL   2
#define MAN_RGB   0
#define MAN_ROT_C   248
#define MAN_ROT_T   128

Definition at line 95 of file transform_manipulator.c.

Referenced by BIF_do_manipulator(), and draw_manipulator_rotate().

#define MAN_ROT_V   64

Definition at line 94 of file transform_manipulator.c.

Referenced by draw_manipulator_rotate(), and draw_manipulator_rotate_cyl().

#define MAN_ROT_X   8
#define MAN_ROT_Y   16
#define MAN_ROT_Z   32
#define MAN_SCALE_C   1792
#define MAN_SCALE_X   256
#define MAN_SCALE_Y   512
#define MAN_SCALE_Z   1024
#define MAN_TRANS_C   7
#define MAN_TRANS_X   1
#define MAN_TRANS_Y   2
#define MAN_TRANS_Z   4

Function Documentation

static void axis_angle_to_gimbal_axis ( float  gmat[3][3],
float  axis[3],
float  angle 
) [static]
static char axisBlendAngle ( float  angle) [static]
int BIF_do_manipulator ( bContext C,
struct wmEvent event,
wmOperator op 
)
void BIF_draw_manipulator ( const bContext C)
int calc_manipulator_stats ( const bContext C)

Definition at line 274 of file transform_manipulator.c.

References applyTransformOrientation(), View3D::around, Scene::base, Nurb::bezt, BKE_mesh_get_editmesh(), BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, Nurb::bp, calc_tw_center(), bPose::chanbase, PTCacheEditKey::co, EditVert::co, copy_m3_m4(), copy_m4_m3(), copy_m4_m4(), count_set_pose_transflags(), CTX_data_edit_object(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), CU_BEZIER, CU_HIDE_HANDLES, curve_editnurbs(), Object::data, Lattice::def, Curve::drawflag, EBONE_VISIBLE, ED_curve_actSelection(), ED_getTransformOrientationMatrix(), bArmature::edbo, EditMesh::edges, MetaBall::editelems, Lattice::editlatt, ELEM, EM_editselection_center(), EM_get_actSelection(), EditFace::f, EditEdge::f, EditVert::f, BPoint::f1, BezTriple::f1, EditVert::f1, BezTriple::f2, BezTriple::f3, EditMesh::faces, ListBase::first, Object::flag, PTCacheEditKey::flag, PTCacheEditPoint::flag, EditBone::flag, gimbal_axis(), EditFace::h, EditEdge::h, EditBone::head, INIT_MINMAX, PTCacheEditPoint::keys, EditLatt::latt, View3D::lay, Object::lay, Object::mode, mul_m4_v3(), mul_v3_fl(), Base::next, bPoseChannel::next, Nurb::next, EditBone::next, EditFace::next, EditEdge::next, EditVert::next, normalize_m3(), normalize_m4(), NULL, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL, OB_MESH, OB_MODE_ALL_PAINT, OB_MODE_PARTICLE_EDIT, OB_MODE_POSE, OB_SURF, OBACT, Base::object, Object::obmat, PE_get_current(), PEK_SELECT, PEK_USE_WCO, PEP_HIDE, Lattice::pntsu, Nurb::pntsu, Lattice::pntsv, Nurb::pntsv, Lattice::pntsw, PTCacheEdit::points, Object::pose, Object::protectflag, protectflag_to_drawflags(), ARegion::regiondata, SCE_SELECT_EDGE, SCE_SELECT_VERTEX, SELECT, ToolSettings::selectmode, ScrArea::spacedata, stats_editbone(), stats_pose(), EditBone::tail, TESTBASELIB, TFM_ROTATION, PTCacheEdit::totpoint, Scene::twcent, RegionView3D::twdrawflag, RegionView3D::twmat, Scene::twmax, Scene::twmin, View3D::twmode, Nurb::type, Object::type, unit_m4(), EditFace::v1, EditEdge::v1, EditFace::v2, EditEdge::v2, EditFace::v3, V3D_ACTIVE, V3D_MANIP_GIMBAL, V3D_MANIP_GLOBAL, V3D_MANIP_LOCAL, V3D_MANIP_NORMAL, V3D_MANIP_VIEW, EditFace::v4, BPoint::vec, BezTriple::vec, EditMesh::verts, RegionView3D::viewinv, and PTCacheEditKey::world_co.

static void calc_tw_center ( Scene scene,
float *  co 
) [static]
static void draw_cone ( GLUquadricObj *  qobj,
float  len,
float  width 
) [static]

Definition at line 1268 of file transform_manipulator.c.

Referenced by draw_manipulator_translate().

static void draw_cylinder ( GLUquadricObj *  qobj,
float  len,
float  width 
) [static]

Definition at line 1278 of file transform_manipulator.c.

Referenced by draw_manipulator_rotate_cyl().

static void draw_manipulator_axes ( View3D v3d,
RegionView3D rv3d,
int  colcode,
int  flagx,
int  flagy,
int  flagz 
) [static]
static void draw_manipulator_rotate ( View3D v3d,
RegionView3D rv3d,
int  moving,
int  drawflags,
int  combo 
) [static]
static void draw_manipulator_rotate_cyl ( View3D v3d,
RegionView3D rv3d,
int  moving,
int  drawflags,
int  combo,
int  colcode 
) [static]
static void draw_manipulator_scale ( View3D v3d,
RegionView3D rv3d,
int  moving,
int  drawflags,
int  combo,
int  colcode 
) [static]
static void draw_manipulator_translate ( View3D v3d,
RegionView3D rv3d,
int   UNUSEDmoving,
int  drawflags,
int  combo,
int  colcode 
) [static]
static void drawsolidcube ( float  size) [static]

Definition at line 1116 of file transform_manipulator.c.

Referenced by draw_manipulator_scale().

int gimbal_axis ( Object ob,
float  gmat[][3] 
)
static int manipulator_selectbuf ( ScrArea sa,
ARegion ar,
const int  mval[2],
float  hotspot 
) [static]
static void manipulator_setcolor ( View3D v3d,
char  axis,
int  colcode,
unsigned char  alpha 
) [static]
static void partial_donut ( float  radring,
float  radhole,
int  start,
int  end,
int  nsides,
int  nrings 
) [static]

Definition at line 671 of file transform_manipulator.c.

References cos(), i, M_PI, and sin().

Referenced by draw_manipulator_rotate().

static void postOrtho ( int  ortho) [static]

Definition at line 855 of file transform_manipulator.c.

Referenced by draw_manipulator_rotate().

static void preOrthoFront ( int  ortho,
float  twmat[][4],
int  axis 
) [static]
static void protectflag_to_drawflags ( short  protectflag,
short *  drawflags 
) [static]
static float screen_aligned ( RegionView3D rv3d,
float  mat[][4] 
) [static]
static void stats_editbone ( RegionView3D rv3d,
EditBone ebo 
) [static]
static void stats_pose ( Scene scene,
RegionView3D rv3d,
bPoseChannel pchan 
) [static]
static void test_manipulator_axis ( const bContext C) [static]
static int test_rotmode_euler ( short  rotmode) [static]

Definition at line 196 of file transform_manipulator.c.

References ELEM, ROT_MODE_AXISANGLE, and ROT_MODE_QUAT.

Referenced by gimbal_axis().


Variable Documentation

int drawflags = 0xFFFF [static]

Definition at line 1475 of file transform_manipulator.c.