misc...
	* shader editor lives on top of main window
	* csg tool: 'active projection' exclusion method instead of axis selection
	* csg tool: new 'selected faces' & 'cam direction' exclusion methods
	* new active projection dependent commands MirrorSelectionHorizontally, MirrorSelectionVertically,
		RotateSelectionClockwise, RotateSelectionAnticlockwise + toolbar buttons
This commit is contained in:
Garux 2017-08-02 09:09:20 +03:00
parent de5fcea336
commit 322b0c2ee4
11 changed files with 219 additions and 73 deletions

View File

@ -60,6 +60,7 @@ void Face_extrude( Face& face, const Brush& brush, brush_vector_t& out, float of
#include "preferences.h" #include "preferences.h"
#include "texwindow.h" #include "texwindow.h"
typedef std::vector<DoubleVector3> doublevector_vector_t;
enum eHollowType enum eHollowType
{ {
@ -83,17 +84,28 @@ class CaulkFace
DoubleVector3 ExclusionAxis; DoubleVector3 ExclusionAxis;
double &mindot; double &mindot;
double &maxdot; double &maxdot;
doublevector_vector_t &exclude_vec;
public: public:
CaulkFace( DoubleVector3 ExclusionAxis, CaulkFace( DoubleVector3 ExclusionAxis,
double &mindot, double &mindot,
double &maxdot ): double &maxdot,
doublevector_vector_t &exclude_vec ):
ExclusionAxis( ExclusionAxis ), ExclusionAxis( ExclusionAxis ),
mindot( mindot ), mindot( mindot ),
maxdot( maxdot ){} maxdot( maxdot ),
exclude_vec( exclude_vec ){}
void operator()( Face& face ) const { void operator()( Face& face ) const {
double dot = vector3_dot( face.getPlane().plane3().normal(), ExclusionAxis ); double dot = vector3_dot( face.getPlane().plane3().normal(), ExclusionAxis );
if( dot == 0 || ( dot > mindot + 0.005 && dot < maxdot - 0.005 ) ) if( dot == 0 || ( dot > mindot + 0.005 && dot < maxdot - 0.005 ) ){
if( !exclude_vec.empty() ){
for ( doublevector_vector_t::const_iterator i = exclude_vec.begin(); i != exclude_vec.end(); ++i ){
if( ( *i ) == face.getPlane().plane3().normal() ){
return;
}
}
}
face.SetShader( getCaulkShader() ); face.SetShader( getCaulkShader() );
}
} }
}; };
@ -106,6 +118,7 @@ eHollowType HollowType;
DoubleVector3 ExclusionAxis; DoubleVector3 ExclusionAxis;
double &mindot; double &mindot;
double &maxdot; double &maxdot;
doublevector_vector_t &exclude_vec;
bool caulk; bool caulk;
bool RemoveInner; bool RemoveInner;
public: public:
@ -116,6 +129,7 @@ FaceMakeBrush( const Brush& brush,
DoubleVector3 ExclusionAxis, DoubleVector3 ExclusionAxis,
double &mindot, double &mindot,
double &maxdot, double &maxdot,
doublevector_vector_t &exclude_vec,
bool caulk, bool caulk,
bool RemoveInner ) bool RemoveInner )
: brush( brush ), : brush( brush ),
@ -125,12 +139,21 @@ FaceMakeBrush( const Brush& brush,
ExclusionAxis( ExclusionAxis ), ExclusionAxis( ExclusionAxis ),
mindot( mindot ), mindot( mindot ),
maxdot( maxdot ), maxdot( maxdot ),
exclude_vec( exclude_vec ),
caulk( caulk ), caulk( caulk ),
RemoveInner( RemoveInner ){ RemoveInner( RemoveInner ){
} }
void operator()( Face& face ) const { void operator()( Face& face ) const {
double dot = vector3_dot( face.getPlane().plane3().normal(), ExclusionAxis ); double dot = vector3_dot( face.getPlane().plane3().normal(), ExclusionAxis );
if( dot == 0 || ( dot > mindot + 0.005 && dot < maxdot - 0.005 ) ){ if( dot == 0 || ( dot > mindot + 0.005 && dot < maxdot - 0.005 ) ){
if( !exclude_vec.empty() ){
for ( doublevector_vector_t::const_iterator i = exclude_vec.begin(); i != exclude_vec.end(); ++i ){
if( ( *i ) == face.getPlane().plane3().normal() ){
return;
}
}
}
if( HollowType == pull ){ if( HollowType == pull ){
if ( face.contributes() ) { if ( face.contributes() ) {
face.getPlane().offset( offset ); face.getPlane().offset( offset );
@ -140,7 +163,7 @@ void operator()( Face& face ) const {
face.planeChanged(); face.planeChanged();
if( caulk ){ if( caulk ){
Brush_forEachFace( *out.back(), CaulkFace( ExclusionAxis, mindot, maxdot ) ); Brush_forEachFace( *out.back(), CaulkFace( ExclusionAxis, mindot, maxdot, exclude_vec ) );
} }
Face* newFace = out.back()->addFace( face ); Face* newFace = out.back()->addFace( face );
if ( newFace != 0 ) { if ( newFace != 0 ) {
@ -272,13 +295,21 @@ float offset;
DoubleVector3 ExclusionAxis; DoubleVector3 ExclusionAxis;
double &mindot; double &mindot;
double &maxdot; double &maxdot;
doublevector_vector_t &exclude_vec;
public: public:
FaceOffset( float offset, DoubleVector3 ExclusionAxis, double &mindot, double &maxdot ) FaceOffset( float offset, DoubleVector3 ExclusionAxis, double &mindot, double &maxdot, doublevector_vector_t &exclude_vec )
: offset( offset ), ExclusionAxis( ExclusionAxis ), mindot( mindot ), maxdot( maxdot ){ : offset( offset ), ExclusionAxis( ExclusionAxis ), mindot( mindot ), maxdot( maxdot ), exclude_vec( exclude_vec ){
} }
void operator()( Face& face ) const { void operator()( Face& face ) const {
double dot = vector3_dot( face.getPlane().plane3().normal(), ExclusionAxis ); double dot = vector3_dot( face.getPlane().plane3().normal(), ExclusionAxis );
if( dot == 0 || ( dot > mindot + 0.005 && dot < maxdot - 0.005 ) ){ if( dot == 0 || ( dot > mindot + 0.005 && dot < maxdot - 0.005 ) ){
if( !exclude_vec.empty() ){
for ( doublevector_vector_t::const_iterator i = exclude_vec.begin(); i != exclude_vec.end(); ++i ){
if( ( *i ) == face.getPlane().plane3().normal() ){
return;
}
}
}
face.undoSave(); face.undoSave();
face.getPlane().offset( offset ); face.getPlane().offset( offset );
face.planeChanged(); face.planeChanged();
@ -286,6 +317,19 @@ void operator()( Face& face ) const {
} }
}; };
class FaceExcludeSelected
{
doublevector_vector_t &outvec;
public:
FaceExcludeSelected( doublevector_vector_t &outvec ): outvec( outvec ){
}
void operator()( FaceInstance& face ) const {
if( face.isSelected() ){
outvec.push_back( face.getFace().getPlane().plane3().normal() );
}
}
};
DoubleVector3 getExclusion(); DoubleVector3 getExclusion();
bool getCaulk(); bool getCaulk();
@ -306,38 +350,42 @@ bool pre( const scene::Path& path, scene::Instance& instance ) const {
&& Instance_getSelectable( instance )->isSelected() && Instance_getSelectable( instance )->isSelected()
&& path.size() > 1 ) { && path.size() > 1 ) {
brush_vector_t out; brush_vector_t out;
doublevector_vector_t exclude_vec;
double mindot = 0; double mindot = 0;
double maxdot = 0; double maxdot = 0;
if( HollowType != room ){ if( HollowType != room ){
Brush_forEachFace( *brush, FaceExclude( getExclusion(), mindot, maxdot ) ); Brush_forEachFace( *brush, FaceExclude( getExclusion(), mindot, maxdot ) );
if( mindot == 0 && maxdot == 0 ){
Brush_ForEachFaceInstance( *Instance_getBrush( instance ), FaceExcludeSelected( exclude_vec ) );
}
} }
if( HollowType == room ){ if( HollowType == room ){
Brush* tmpbrush = new Brush( *brush ); Brush* tmpbrush = new Brush( *brush );
tmpbrush->removeEmptyFaces(); tmpbrush->removeEmptyFaces();
Brush_forEachFace( *brush, FaceMakeBrush( *brush, out, offset, pull, DoubleVector3( 0, 0, 0 ), mindot, maxdot, true, true ) ); Brush_forEachFace( *brush, FaceMakeBrush( *brush, out, offset, pull, DoubleVector3( 0, 0, 0 ), mindot, maxdot, exclude_vec, true, true ) );
delete tmpbrush; delete tmpbrush;
} }
else if( HollowType == pull ){ else if( HollowType == pull ){
if( !getRemoveInner() && getCaulk() ){ if( !getRemoveInner() && getCaulk() ){
Brush_forEachFace( *brush, CaulkFace( getExclusion(), mindot, maxdot ) ); Brush_forEachFace( *brush, CaulkFace( getExclusion(), mindot, maxdot, exclude_vec ) );
} }
Brush* tmpbrush = new Brush( *brush ); Brush* tmpbrush = new Brush( *brush );
tmpbrush->removeEmptyFaces(); tmpbrush->removeEmptyFaces();
Brush_forEachFace( *tmpbrush, FaceMakeBrush( *tmpbrush, out, offset, HollowType, getExclusion(), mindot, maxdot, getCaulk(), getRemoveInner() ) ); Brush_forEachFace( *tmpbrush, FaceMakeBrush( *tmpbrush, out, offset, HollowType, getExclusion(), mindot, maxdot, exclude_vec, getCaulk(), getRemoveInner() ) );
delete tmpbrush; delete tmpbrush;
} }
else if( HollowType == diag ){ else if( HollowType == diag ){
Brush* tmpbrush = new Brush( *brush ); Brush* tmpbrush = new Brush( *brush );
Brush_forEachFace( *tmpbrush, FaceOffset( offset, getExclusion(), mindot, maxdot ) ); Brush_forEachFace( *tmpbrush, FaceOffset( offset, getExclusion(), mindot, maxdot, exclude_vec ) );
tmpbrush->removeEmptyFaces(); tmpbrush->removeEmptyFaces();
Brush_forEachFace( *tmpbrush, FaceMakeBrush( *brush, out, offset, HollowType, getExclusion(), mindot, maxdot, getCaulk(), getRemoveInner() ) ); Brush_forEachFace( *tmpbrush, FaceMakeBrush( *brush, out, offset, HollowType, getExclusion(), mindot, maxdot, exclude_vec, getCaulk(), getRemoveInner() ) );
delete tmpbrush; delete tmpbrush;
if( !getRemoveInner() && getCaulk() ){ if( !getRemoveInner() && getCaulk() ){
Brush_forEachFace( *brush, CaulkFace( getExclusion(), mindot, maxdot ) ); Brush_forEachFace( *brush, CaulkFace( getExclusion(), mindot, maxdot, exclude_vec ) );
} }
} }
else{ else{
Brush_forEachFace( *brush, FaceMakeBrush( *brush, out, offset, HollowType, getExclusion(), mindot, maxdot, getCaulk(), getRemoveInner() ) ); Brush_forEachFace( *brush, FaceMakeBrush( *brush, out, offset, HollowType, getExclusion(), mindot, maxdot, exclude_vec, getCaulk(), getRemoveInner() ) );
} }
for ( brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i ) for ( brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i )
{ {
@ -953,26 +1001,45 @@ void CSG_Merge( void ){
#include "gtkutil/dialog.h" #include "gtkutil/dialog.h"
#include "gtkutil/button.h" #include "gtkutil/button.h"
#include "gtkutil/accelerator.h" #include "gtkutil/accelerator.h"
#include "xywindow.h"
#include "camwindow.h"
struct CSGToolDialog struct CSGToolDialog
{ {
GtkSpinButton* spin; GtkSpinButton* spin;
GtkWindow *window; GtkWindow *window;
GtkToggleButton *radXYZ, *radX, *radY, *radZ, *caulk, *removeInner; GtkToggleButton *radFaces, *radProj, *radCam, *caulk, *removeInner;
}; };
CSGToolDialog g_csgtool_dialog; CSGToolDialog g_csgtool_dialog;
DoubleVector3 getExclusion(){ DoubleVector3 getExclusion(){
if( gtk_toggle_button_get_active( g_csgtool_dialog.radX ) ){ if( gtk_toggle_button_get_active( g_csgtool_dialog.radProj ) ){
if( GlobalXYWnd_getCurrentViewType() == YZ ){
return DoubleVector3( 1, 0, 0 ); return DoubleVector3( 1, 0, 0 );
} }
else if( gtk_toggle_button_get_active( g_csgtool_dialog.radY ) ){ else if( GlobalXYWnd_getCurrentViewType() == XZ ){
return DoubleVector3( 0, 1, 0 ); return DoubleVector3( 0, 1, 0 );
} }
else if( gtk_toggle_button_get_active( g_csgtool_dialog.radZ ) ){ else if( GlobalXYWnd_getCurrentViewType() == XY ){
return DoubleVector3( 0, 0, 1 ); return DoubleVector3( 0, 0, 1 );
} }
}
if( gtk_toggle_button_get_active( g_csgtool_dialog.radCam ) ){
Vector3 angles( Camera_getAngles( *g_pParentWnd->GetCamWnd() ) );
// globalOutputStream() << angles << " angles\n";
DoubleVector3 radangles( degrees_to_radians( angles[0] ), degrees_to_radians( angles[1] ), degrees_to_radians( angles[2] ) );
// globalOutputStream() << radangles << " radangles\n";
// x = cos(yaw)*cos(pitch)
// y = sin(yaw)*cos(pitch)
// z = sin(pitch)
DoubleVector3 viewvector;
viewvector[0] = cos( radangles[1] ) * cos( radangles[0] );
viewvector[1] = sin( radangles[1] ) * cos( radangles[0] );
viewvector[2] = sin( radangles[0] );
// globalOutputStream() << viewvector << " viewvector\n";
return viewvector;
}
return DoubleVector3( 0, 0, 0 ); return DoubleVector3( 0, 0, 0 );
} }
@ -1000,8 +1067,12 @@ BrushFaceOffset( float offset )
void operator()( BrushInstance& brush ) const { void operator()( BrushInstance& brush ) const {
double mindot = 0; double mindot = 0;
double maxdot = 0; double maxdot = 0;
doublevector_vector_t exclude_vec;
Brush_forEachFace( brush, FaceExclude( getExclusion(), mindot, maxdot ) ); Brush_forEachFace( brush, FaceExclude( getExclusion(), mindot, maxdot ) );
Brush_forEachFace( brush, FaceOffset( offset, getExclusion(), mindot, maxdot ) ); if( mindot == 0 && maxdot == 0 ){
Brush_ForEachFaceInstance( brush, FaceExcludeSelected( exclude_vec ) );
}
Brush_forEachFace( brush, FaceOffset( offset, getExclusion(), mindot, maxdot, exclude_vec ) );
} }
}; };
@ -1120,32 +1191,30 @@ void CSG_Tool(){
} }
{ {
//radio button group for choosing the exclude axis //radio button group for choosing the exclude axis
GtkWidget* radXYZ = gtk_radio_button_new_with_label( NULL, "XYZ" ); GtkWidget* radFaces = gtk_radio_button_new_with_label( NULL, "-faces" );
GtkWidget* radX = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(radXYZ), "-X" ); gtk_widget_set_tooltip_text( radFaces, "Exclude selected faces" );
GtkWidget* radY = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(radXYZ), "-Y" ); GtkWidget* radProj = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(radFaces), "-proj" );
GtkWidget* radZ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(radXYZ), "-Z" ); gtk_widget_set_tooltip_text( radProj, "Exclude faces, most orthogonal to active projection" );
gtk_widget_show( radXYZ ); GtkWidget* radCam = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(radFaces), "-cam" );
gtk_widget_show( radX ); gtk_widget_set_tooltip_text( radCam, "Exclude faces, most orthogonal to camera view" );
gtk_widget_show( radY );
gtk_widget_show( radZ );
gtk_table_attach( table, radXYZ, 2, 3, 0, 1, gtk_widget_show( radFaces );
gtk_widget_show( radProj );
gtk_widget_show( radCam );
gtk_table_attach( table, radFaces, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_table_attach( table, radX, 3, 4, 0, 1, gtk_table_attach( table, radProj, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
gtk_table_attach( table, radY, 4, 5, 0, 1, gtk_table_attach( table, radCam, 4, 5, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_table_attach( table, radZ, 5, 6, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 ); (GtkAttachOptions) ( 0 ), 0, 0 );
g_csgtool_dialog.radXYZ = GTK_TOGGLE_BUTTON( radXYZ ); g_csgtool_dialog.radFaces = GTK_TOGGLE_BUTTON( radFaces );
g_csgtool_dialog.radX = GTK_TOGGLE_BUTTON( radX ); g_csgtool_dialog.radProj = GTK_TOGGLE_BUTTON( radProj );
g_csgtool_dialog.radY = GTK_TOGGLE_BUTTON( radY ); g_csgtool_dialog.radCam = GTK_TOGGLE_BUTTON( radCam );
g_csgtool_dialog.radZ = GTK_TOGGLE_BUTTON( radZ );
} }
{ {
GtkWidget* button = gtk_toggle_button_new(); GtkWidget* button = gtk_toggle_button_new();

View File

@ -794,11 +794,8 @@ static void CreateGtkTextEditor(){
GtkWidget *dlg; GtkWidget *dlg;
GtkWidget *vbox, *hbox, *button, *scr, *text; GtkWidget *vbox, *hbox, *button, *scr, *text;
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); GtkWindow* dlg_wnd = create_dialog_window( MainFrame_getWindow(), "", G_CALLBACK( editor_delete ), 0, 400, 600 );
dlg = GTK_WIDGET( dlg_wnd );
g_signal_connect( G_OBJECT( dlg ), "delete_event",
G_CALLBACK( editor_delete ), 0 );
gtk_window_set_default_size( GTK_WINDOW( dlg ), 400, 600 );
vbox = gtk_vbox_new( FALSE, 5 ); vbox = gtk_vbox_new( FALSE, 5 );
gtk_widget_show( vbox ); gtk_widget_show( vbox );

View File

@ -2068,6 +2068,9 @@ GtkMenuItem* create_selection_menu(){
create_menu_item_with_mnemonic( menu_in_menu, "Rotate X", "RotateSelectionX" ); create_menu_item_with_mnemonic( menu_in_menu, "Rotate X", "RotateSelectionX" );
create_menu_item_with_mnemonic( menu_in_menu, "Rotate Y", "RotateSelectionY" ); create_menu_item_with_mnemonic( menu_in_menu, "Rotate Y", "RotateSelectionY" );
create_menu_item_with_mnemonic( menu_in_menu, "Rotate Z", "RotateSelectionZ" ); create_menu_item_with_mnemonic( menu_in_menu, "Rotate Z", "RotateSelectionZ" );
menu_separator( menu_in_menu );
create_menu_item_with_mnemonic( menu_in_menu, "Rotate Clockwise", "RotateSelectionClockwise" );
create_menu_item_with_mnemonic( menu_in_menu, "Rotate Anticlockwise", "RotateSelectionAnticlockwise" );
} }
{ {
GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Flip" ); GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Flip" );
@ -2077,6 +2080,9 @@ GtkMenuItem* create_selection_menu(){
create_menu_item_with_mnemonic( menu_in_menu, "Flip _X", "MirrorSelectionX" ); create_menu_item_with_mnemonic( menu_in_menu, "Flip _X", "MirrorSelectionX" );
create_menu_item_with_mnemonic( menu_in_menu, "Flip _Y", "MirrorSelectionY" ); create_menu_item_with_mnemonic( menu_in_menu, "Flip _Y", "MirrorSelectionY" );
create_menu_item_with_mnemonic( menu_in_menu, "Flip _Z", "MirrorSelectionZ" ); create_menu_item_with_mnemonic( menu_in_menu, "Flip _Z", "MirrorSelectionZ" );
menu_separator( menu_in_menu );
create_menu_item_with_mnemonic( menu_in_menu, "Flip Horizontally", "MirrorSelectionHorizontally" );
create_menu_item_with_mnemonic( menu_in_menu, "Flip Vertically", "MirrorSelectionVertically" );
} }
menu_separator( menu ); menu_separator( menu );
create_menu_item_with_mnemonic( menu, "Arbitrary rotation...", "ArbitraryRotation" ); create_menu_item_with_mnemonic( menu, "Arbitrary rotation...", "ArbitraryRotation" );
@ -2322,12 +2328,17 @@ void UndoRedo_constructToolbar( GtkToolbar* toolbar ){
} }
void RotateFlip_constructToolbar( GtkToolbar* toolbar ){ void RotateFlip_constructToolbar( GtkToolbar* toolbar ){
toolbar_append_button( toolbar, "x-axis Flip", "brush_flipx.png", "MirrorSelectionX" ); // toolbar_append_button( toolbar, "x-axis Flip", "brush_flipx.png", "MirrorSelectionX" );
toolbar_append_button( toolbar, "x-axis Rotate", "brush_rotatex.png", "RotateSelectionX" ); // toolbar_append_button( toolbar, "x-axis Rotate", "brush_rotatex.png", "RotateSelectionX" );
toolbar_append_button( toolbar, "y-axis Flip", "brush_flipy.png", "MirrorSelectionY" ); // toolbar_append_button( toolbar, "y-axis Flip", "brush_flipy.png", "MirrorSelectionY" );
toolbar_append_button( toolbar, "y-axis Rotate", "brush_rotatey.png", "RotateSelectionY" ); // toolbar_append_button( toolbar, "y-axis Rotate", "brush_rotatey.png", "RotateSelectionY" );
toolbar_append_button( toolbar, "z-axis Flip", "brush_flipz.png", "MirrorSelectionZ" ); // toolbar_append_button( toolbar, "z-axis Flip", "brush_flipz.png", "MirrorSelectionZ" );
toolbar_append_button( toolbar, "z-axis Rotate", "brush_rotatez.png", "RotateSelectionZ" ); // toolbar_append_button( toolbar, "z-axis Rotate", "brush_rotatez.png", "RotateSelectionZ" );
toolbar_append_button( toolbar, "Flip Horizontally", "brush_flip_hor.png", "MirrorSelectionHorizontally" );
toolbar_append_button( toolbar, "Flip Vertically", "brush_flip_vert.png", "MirrorSelectionVertically" );
toolbar_append_button( toolbar, "Rotate Clockwise", "brush_rotate_clock.png", "RotateSelectionClockwise" );
toolbar_append_button( toolbar, "Rotate Anticlockwise", "brush_rotate_anti.png", "RotateSelectionAnticlockwise" );
} }
void Select_constructToolbar( GtkToolbar* toolbar ){ void Select_constructToolbar( GtkToolbar* toolbar ){
@ -2393,7 +2404,7 @@ GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){
ComponentModes_constructToolbar( toolbar ); ComponentModes_constructToolbar( toolbar );
gtk_toolbar_append_space( toolbar ); gtk_toolbar_append_space( toolbar );
if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) { if ( style != MainFrame::eSplit ) {
XYWnd_constructToolbar( toolbar ); XYWnd_constructToolbar( toolbar );
gtk_toolbar_append_space( toolbar ); gtk_toolbar_append_space( toolbar );
} }
@ -3384,19 +3395,12 @@ void MainFrame_Construct(){
// GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) ); // GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
// GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) ); // GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) );
Hide_registerCommands(); Select_registerCommands();
GlobalToggles_insert( "DragVertices", FreeCaller<SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) ); GlobalToggles_insert( "DragVertices", FreeCaller<SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
GlobalToggles_insert( "DragEdges", FreeCaller<SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) ); GlobalToggles_insert( "DragEdges", FreeCaller<SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
GlobalToggles_insert( "DragFaces", FreeCaller<SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) ); GlobalToggles_insert( "DragFaces", FreeCaller<SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
GlobalCommands_insert( "MirrorSelectionX", FreeCaller<Selection_Flipx>() );
GlobalCommands_insert( "RotateSelectionX", FreeCaller<Selection_Rotatex>() );
GlobalCommands_insert( "MirrorSelectionY", FreeCaller<Selection_Flipy>() );
GlobalCommands_insert( "RotateSelectionY", FreeCaller<Selection_Rotatey>() );
GlobalCommands_insert( "MirrorSelectionZ", FreeCaller<Selection_Flipz>() );
GlobalCommands_insert( "RotateSelectionZ", FreeCaller<Selection_Rotatez>() );
GlobalCommands_insert( "ArbitraryRotation", FreeCaller<DoRotateDlg>(), Accelerator( 'R', (GdkModifierType)GDK_SHIFT_MASK ) ); GlobalCommands_insert( "ArbitraryRotation", FreeCaller<DoRotateDlg>(), Accelerator( 'R', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalCommands_insert( "ArbitraryScale", FreeCaller<DoScaleDlg>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "ArbitraryScale", FreeCaller<DoScaleDlg>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );

View File

@ -778,12 +778,6 @@ void Select_ShowAllHidden(){
g_hidden_item.update(); g_hidden_item.update();
} }
void Hide_registerCommands(){
GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalToggles_insert( "HideSelected", FreeCaller<HideSelected>(), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
}
void Selection_Flipx(){ void Selection_Flipx(){
UndoableCommand undo( "mirrorSelected -axis x" ); UndoableCommand undo( "mirrorSelected -axis x" );
@ -814,7 +808,89 @@ void Selection_Rotatez(){
UndoableCommand undo( "rotateSelected -axis z -angle -90" ); UndoableCommand undo( "rotateSelected -axis z -angle -90" );
Select_RotateAxis( 2,-90 ); Select_RotateAxis( 2,-90 );
} }
#include "xywindow.h"
void Selection_FlipHorizontally(){
VIEWTYPE viewtype = GlobalXYWnd_getCurrentViewType();
switch ( viewtype )
{
case XY:
case XZ:
Selection_Flipx();
break;
default:
Selection_Flipy();
break;
}
}
void Selection_FlipVertically(){
VIEWTYPE viewtype = GlobalXYWnd_getCurrentViewType();
switch ( viewtype )
{
case XZ:
case YZ:
Selection_Flipz();
break;
default:
Selection_Flipy();
break;
}
}
void Selection_RotateClockwise(){
UndoableCommand undo( "rotateSelected Clockwise 90" );
VIEWTYPE viewtype = GlobalXYWnd_getCurrentViewType();
switch ( viewtype )
{
case XY:
Select_RotateAxis( 2, -90 );
break;
case XZ:
Select_RotateAxis( 1, 90 );
break;
default:
Select_RotateAxis( 0, -90 );
break;
}
}
void Selection_RotateAnticlockwise(){
UndoableCommand undo( "rotateSelected Anticlockwise 90" );
VIEWTYPE viewtype = GlobalXYWnd_getCurrentViewType();
switch ( viewtype )
{
case XY:
Select_RotateAxis( 2, 90 );
break;
case XZ:
Select_RotateAxis( 1, -90 );
break;
default:
Select_RotateAxis( 0, 90 );
break;
}
}
void Select_registerCommands(){
GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalToggles_insert( "HideSelected", FreeCaller<HideSelected>(), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
GlobalCommands_insert( "MirrorSelectionX", FreeCaller<Selection_Flipx>() );
GlobalCommands_insert( "RotateSelectionX", FreeCaller<Selection_Rotatex>() );
GlobalCommands_insert( "MirrorSelectionY", FreeCaller<Selection_Flipy>() );
GlobalCommands_insert( "RotateSelectionY", FreeCaller<Selection_Rotatey>() );
GlobalCommands_insert( "MirrorSelectionZ", FreeCaller<Selection_Flipz>() );
GlobalCommands_insert( "RotateSelectionZ", FreeCaller<Selection_Rotatez>() );
GlobalCommands_insert( "MirrorSelectionHorizontally", FreeCaller<Selection_FlipHorizontally>() );
GlobalCommands_insert( "MirrorSelectionVertically", FreeCaller<Selection_FlipVertically>() );
GlobalCommands_insert( "RotateSelectionClockwise", FreeCaller<Selection_RotateClockwise>() );
GlobalCommands_insert( "RotateSelectionAnticlockwise", FreeCaller<Selection_RotateAnticlockwise>() );
}
void Nudge( int nDim, float fNudge ){ void Nudge( int nDim, float fNudge ){

View File

@ -33,12 +33,12 @@ void Select_Inside();
void Select_Touching(); void Select_Touching();
void Scene_ExpandSelectionToEntities(); void Scene_ExpandSelectionToEntities();
void Selection_Flipx(); //void Selection_Flipx();
void Selection_Flipy(); //void Selection_Flipy();
void Selection_Flipz(); //void Selection_Flipz();
void Selection_Rotatex(); //void Selection_Rotatex();
void Selection_Rotatey(); //void Selection_Rotatey();
void Selection_Rotatez(); //void Selection_Rotatez();
void Selection_MoveDown(); void Selection_MoveDown();
@ -66,7 +66,7 @@ void FindReplaceTextures( const char* pFind, const char* pReplace, bool bSelecte
void HideSelected(); void HideSelected();
void Select_ShowAllHidden(); void Select_ShowAllHidden();
void Hide_registerCommands(); void Select_registerCommands();
// updating workzone to a given brush (depends on current view) // updating workzone to a given brush (depends on current view)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 349 B