2011-11-06 18:18:20 +01:00
|
|
|
// Copyright (c) 2011, Thomas Goyne <plorkyeran@aegisub.org>
|
2007-07-05 06:32:46 +02:00
|
|
|
//
|
2011-11-06 18:18:20 +01:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2007-07-05 06:32:46 +02:00
|
|
|
//
|
2011-11-06 18:18:20 +01:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2007-07-05 06:32:46 +02:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2007-07-05 06:32:46 +02:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file visual_tool_vector_clip.h
|
|
|
|
/// @see visual_tool_vector_clip.cpp
|
|
|
|
/// @ingroup visual_ts
|
|
|
|
///
|
2007-07-05 06:32:46 +02:00
|
|
|
|
2010-05-20 10:55:46 +02:00
|
|
|
#include "visual_feature.h"
|
2007-07-05 06:32:46 +02:00
|
|
|
#include "visual_tool.h"
|
|
|
|
#include "spline.h"
|
|
|
|
|
2010-05-16 08:39:11 +02:00
|
|
|
class wxToolBar;
|
2007-07-05 06:32:46 +02:00
|
|
|
|
2010-05-20 10:55:52 +02:00
|
|
|
/// @class VisualToolVectorClipDraggableFeature
|
|
|
|
/// @brief VisualDraggableFeature with information about a feature's location
|
|
|
|
/// in the spline
|
2011-11-06 18:18:20 +01:00
|
|
|
struct VisualToolVectorClipDraggableFeature : public VisualDraggableFeature {
|
2010-05-20 10:55:52 +02:00
|
|
|
/// Which curve in the spline this feature is a point on
|
2010-06-08 08:09:19 +02:00
|
|
|
Spline::iterator curve;
|
2010-05-20 10:55:52 +02:00
|
|
|
/// 0-3; indicates which part of the curve this point is
|
|
|
|
int point;
|
|
|
|
/// @brief Constructor
|
|
|
|
VisualToolVectorClipDraggableFeature()
|
|
|
|
: VisualDraggableFeature()
|
|
|
|
, point(0)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// DOCME
|
|
|
|
/// @class VisualToolVectorClip
|
|
|
|
/// @brief DOCME
|
2010-05-20 10:55:52 +02:00
|
|
|
class VisualToolVectorClip : public VisualTool<VisualToolVectorClipDraggableFeature> {
|
2010-06-08 08:09:19 +02:00
|
|
|
Spline spline; /// The current spline
|
|
|
|
wxToolBar *toolBar; /// The subtoolbar
|
2010-06-18 09:14:23 +02:00
|
|
|
int mode; /// 0-7
|
|
|
|
bool inverse; /// is iclip?
|
2007-07-07 07:51:18 +02:00
|
|
|
|
2010-06-08 08:09:19 +02:00
|
|
|
/// @brief Set the mode
|
|
|
|
/// @param mode 0-7
|
2007-07-07 07:51:18 +02:00
|
|
|
void SetMode(int mode);
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
void Save();
|
|
|
|
|
2010-06-18 09:14:23 +02:00
|
|
|
void SelectAll();
|
|
|
|
void MakeFeature(Spline::iterator cur);
|
2010-06-30 08:29:14 +02:00
|
|
|
void MakeFeatures();
|
2010-06-18 09:14:23 +02:00
|
|
|
|
2010-05-20 10:55:35 +02:00
|
|
|
bool InitializeHold();
|
2007-07-07 07:51:18 +02:00
|
|
|
void UpdateHold();
|
2007-07-05 06:32:46 +02:00
|
|
|
|
2010-06-30 08:29:14 +02:00
|
|
|
void UpdateDrag(feature_iterator feature);
|
|
|
|
bool InitializeDrag(feature_iterator feature);
|
2007-07-05 06:32:46 +02:00
|
|
|
|
|
|
|
void DoRefresh();
|
2010-06-28 09:13:15 +02:00
|
|
|
void Draw();
|
2007-07-05 06:32:46 +02:00
|
|
|
public:
|
2011-11-06 18:18:20 +01:00
|
|
|
VisualToolVectorClip(VideoDisplay *parent, agi::Context *context);
|
|
|
|
void SetToolbar(wxToolBar *tb);
|
2007-07-05 06:32:46 +02:00
|
|
|
|
2010-06-08 08:09:02 +02:00
|
|
|
/// Subtoolbar button click handler
|
2010-05-16 08:39:11 +02:00
|
|
|
void OnSubTool(wxCommandEvent &event);
|
2007-07-05 06:32:46 +02:00
|
|
|
};
|