本文整理汇总了C++中SPDocument::getCurrentPersp3DImpl方法的典型用法代码示例。如果您正苦于以下问题:C++ SPDocument::getCurrentPersp3DImpl方法的具体用法?C++ SPDocument::getCurrentPersp3DImpl怎么用?C++ SPDocument::getCurrentPersp3DImpl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPDocument
的用法示例。
在下文中一共展示了SPDocument::getCurrentPersp3DImpl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: box3d_toolbox_prep
void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
EgeAdjustmentAction* eact = 0;
SPDocument *document = sp_desktop_document (desktop);
Persp3DImpl *persp_impl = document->getCurrentPersp3DImpl();
EgeAdjustmentAction* box3d_angle_x = 0;
EgeAdjustmentAction* box3d_angle_y = 0;
EgeAdjustmentAction* box3d_angle_z = 0;
/* Angle X */
{
gchar const* labels[] = { 0, 0, 0, 0, 0, 0, 0 };
gdouble values[] = {-90, -60, -30, 0, 30, 60, 90};
eact = create_adjustment_action( "3DBoxAngleXAction",
_("Angle in X direction"), _("Angle X:"),
// Translators: PL is short for 'perspective line'
_("Angle of PLs in X direction"),
"/tools/shapes/3dbox/box3d_angle_x", 30,
GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-box3d",
-360.0, 360.0, 1.0, 10.0,
labels, values, G_N_ELEMENTS(labels),
box3d_angle_x_value_changed );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
g_object_set_data( holder, "box3d_angle_x_action", eact );
box3d_angle_x = eact;
}
if (!persp_impl || !persp3d_VP_is_finite(persp_impl, Proj::X)) {
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
} else {
gtk_action_set_sensitive( GTK_ACTION(eact), FALSE );
}
/* VP X state */
{
InkToggleAction* act = ink_toggle_action_new( "3DBoxVPXStateAction",
// Translators: VP is short for 'vanishing point'
_("State of VP in X direction"),
_("Toggle VP in X direction between 'finite' and 'infinite' (=parallel)"),
INKSCAPE_ICON("perspective-parallel"),
Inkscape::ICON_SIZE_DECORATION );
gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
g_object_set_data( holder, "box3d_vp_x_state_action", act );
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(box3d_vp_x_state_changed), box3d_angle_x );
gtk_action_set_sensitive( GTK_ACTION(box3d_angle_x), !prefs->getBool("/tools/shapes/3dbox/vp_x_state", true) );
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/shapes/3dbox/vp_x_state", true) );
}
/* Angle Y */
{
gchar const* labels[] = { 0, 0, 0, 0, 0, 0, 0 };
gdouble values[] = {-90, -60, -30, 0, 30, 60, 90};
eact = create_adjustment_action( "3DBoxAngleYAction",
_("Angle in Y direction"), _("Angle Y:"),
// Translators: PL is short for 'perspective line'
_("Angle of PLs in Y direction"),
"/tools/shapes/3dbox/box3d_angle_y", 30,
GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL,
-360.0, 360.0, 1.0, 10.0,
labels, values, G_N_ELEMENTS(labels),
box3d_angle_y_value_changed );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
g_object_set_data( holder, "box3d_angle_y_action", eact );
box3d_angle_y = eact;
}
if (!persp_impl || !persp3d_VP_is_finite(persp_impl, Proj::Y)) {
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
} else {
gtk_action_set_sensitive( GTK_ACTION(eact), FALSE );
}
/* VP Y state */
{
InkToggleAction* act = ink_toggle_action_new( "3DBoxVPYStateAction",
// Translators: VP is short for 'vanishing point'
_("State of VP in Y direction"),
_("Toggle VP in Y direction between 'finite' and 'infinite' (=parallel)"),
INKSCAPE_ICON("perspective-parallel"),
Inkscape::ICON_SIZE_DECORATION );
gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
g_object_set_data( holder, "box3d_vp_y_state_action", act );
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(box3d_vp_y_state_changed), box3d_angle_y );
gtk_action_set_sensitive( GTK_ACTION(box3d_angle_y), !prefs->getBool("/tools/shapes/3dbox/vp_y_state", true) );
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/shapes/3dbox/vp_y_state", true) );
}
/* Angle Z */
{
gchar const* labels[] = { 0, 0, 0, 0, 0, 0, 0 };
gdouble values[] = {-90, -60, -30, 0, 30, 60, 90};
eact = create_adjustment_action( "3DBoxAngleZAction",
_("Angle in Z direction"), _("Angle Z:"),
// Translators: PL is short for 'perspective line'
_("Angle of PLs in Z direction"),
"/tools/shapes/3dbox/box3d_angle_z", 30,
GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL,
//.........这里部分代码省略.........