Script
Classes | Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Private Types | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
ImportDrawingDlg Class Reference

#include <drawingimportdlg.h>

Inheritance diagram for ImportDrawingDlg:
Inheritance graph
[legend]
Collaboration diagram for ImportDrawingDlg:
Collaboration graph
[legend]

Classes

struct  CreateSymbolInfo
 
struct  LayerGroupInfo
 
struct  TUDrawingImportElement
 
class  TUDrawingImportItem
 
struct  TUDrawingImportSimpleVectoOptions
 
class  TUModuleSelectionPredicate
 

Public Types

enum  ImportMode {
  IM_DRAWING, IM_TIMING, IM_SCAN, IM_DRAWING_SCENEMACHINE,
  IM_3D_MODELS, IM_MOVIE
}
 

Public Slots

int exec ()
 
int getInsertFrame ()
 The frame where the imported drawing is being inserted.
 
int getOrderForNewElement ()
 Not used.
 
int getPositionForNewElement ()
 Not used.
 
void importOneSymbol (String &symbolName)
 All imported items will be imported into a single symbol.
 
bool isSingleSymbolImport ()
 Check if import in single symbol is enable.
 
void setInsertFrame (int insertFrame)
 Set the frame where the imported drawing is being inserted.
 
void setOrderForNewElement (int order)
 Not used.
 
void setPositionForNewElement (int position)
 Not used.
 
void setSingleSymbolImport (bool single)
 Set the import in single symbole.
 
void setImportFiles (StringList &files)
 Select all the files that are imported.
 
bool wasElementCreated ()
 Check if the imported element was created.
 

Public Member Functions

 ImportDrawingDlg (QWidget *parent, SC_Session *session, String &initialModule, int frameNum, int orderForNewElement, int positionForNewElement, bool loadPrefs, ImportMode importMode=IM_DRAWING, bool vectorize=!WHO_Features::hasSimplifiedVectorization())
 
virtual ~ImportDrawingDlg ()
 
void silentApply (int frame, String &file, String &drawingName, String &columnName)
 
bool silentApply (int frame, String &file, String &drawingName)
 
void selectModules (TUGroup *group, TUModuleSelectionPredicate &predicate, std::vector< MO_ElementModule * > &dest)
 
TUTimedValue * getAffectedTimedValue ()
 

Static Public Member Functions

static PLUG_ImportEngine * importEngine ()
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *e)
 
virtual void keyPressEvent (QKeyEvent *e)
 
virtual void polishEvent ()
 
virtual bool event (QEvent *)
 

Properties

int insertFrame
 
int orderForNewElement
 
int positionForNewElement
 
bool singleSymbolImport
 

Private Types

typedef std::vector
< TUDrawingImportItem
Items
 
typedef std::vector
< LayerGroupInfo
LayerGroups
 
typedef std::map< String,
TUDrawingImportElement
ImportTable
 
typedef std::map< String,
MO_ElementModule * > 
ElemModules
 

Private Slots

void dynamicContentUpdate ()
 Change the value of the current panning level.
 
void apply ()
 Last part of the import pipeline. We import the image in the scene.
 
void enableApply ()
 
void fileSelector ()
 
void addToElementButtonToggled (bool on)
 We want to change controls availability if these button are toggled.
 
void elementButtonToggled (bool on)
 
void timingButtonToggled (bool on)
 
void addToTimingButtonToggled (bool on)
 
void createOneElementToggled (bool on)
 
void createElementsBasedOnFilenamesToggled (bool on)
 
void createOneTimingToggled (bool on)
 
void createTimingsBasedOnFilenamesToggled (bool on)
 
void copyCBToggled (bool on)
 
void filesEntered ()
 Build item.
 
void checkExtension (String &name)
 
void timedValueChanged (int item)
 
void toggleCreateSymbol (bool enable)
 
void toggleVecto (bool enable)
 
void toggleBitmapAsLayer (bool enable)
 
void toggleSimpleVectoOptions (bool enable)
 
void toggleBWSimpleVectoOptions (bool enable)
 
void autoApplySimpleVectoOptions ()
 
void resetPreview ()
 Reset, update or change preview depending of the operation.
 
void updatePreview ()
 
void togglePreview (bool on)
 
void scalePreview (int scaleFactor)
 
void zoomInPreview ()
 
void zoomOutPreview ()
 
void cancel ()
 
void setPanning (int)
 
void setFlip ()
 Flip the current preview image horizontaly.
 
void setOverwrite (bool)
 Get the overwrite permission it will change the drawing name and the hold value.
 
void editVectorizePreset ()
 Open vectorize dialog and let users edit their presets.
 
void simpleVectoApply ()
 Vectorize the current preview.
 
void simpleVectoTimeout ()
 
void useScanner ()
 
void scanEnd ()
 
void updateNumScannedImages ()
 
void simpleScan ()
 
void simpleScanPreview ()
 

Private Member Functions

void populateDynamicContainer (QWidget *parent)
 
void buildItems (bool showErrorDialog=false)
 
TUDrawingImportElementgetDrawingImportElement (String &elementName)
 
TUDrawingImportElementaddElementToImport (String &elementName, String &drawingExt, String &originDir)
 
size_t getNumItemsToImport ()
 
void buildItemsInScannerMode ()
 
bool doPreImport ()
 
bool convert3dModelToOSB ()
 
bool createSymbol (CreateSymbolInfo &i_info, TUDrawingImportElement &ie, TUElement &o_elem, TUScene *&o_scene, TUElementTimedValue *&o_sceneTV)
 
void importElement (TUElementTimedValue *tv=NULL, AT_Attr *attr=NULL)
 
bool vectorizeFileItem (TUDrawingImportItem &item, TUSeqTimedValue *tv, AT_Attr *attr)
 
bool vectorizeFileItem (TUDrawingImportItem &item, TUSeqTimedValue *tv, AT_Attr *attr, CELIO_LayerInfo &layerInfo)
 
bool vectorizeLayer (CELIO_Layer &layer, TUDrawingImportItem &item, TUSeqTimedValue *tv, AT_Attr *attr)
 
GR_CompositeVectorDrawingObj * vectorizeScannedItem (TUDrawingImportItem &item, CEL_Rep celRep)
 Caller must call delete on returned drawing.
 
void importTiming (MO_ElementModule *existingElemModule=0, TUTimingTimedValue *existingTv=0)
 
void fileError (String fname, MSG_Text &msg, bool showErrorDialog)
 
void doDeletes ()
 
bool copyFileToFile (String src, String dstFilename)
 
void truncateFileList (StringList &i_fileList, String &io_strFileList)
 
void getImportFiles (StringList &o_fileList)
 
String makeDrawingFilename (String &elementName, String &timing, String &extension, String &dstDir)
 
String makeDrawingFilename (TUSeqTimedValue *tv, AT_Attr *attr, String &timing)
 
bool importPixmapFile (String &srcFilename, String &elementName, String &timing, String &destExtension, TUSeqTimedValue *tv, AT_Attr *attr)
 
bool writeImageToDir (CEL_Rep &celRep, GR_CompositeVectorDrawingObj *vectorizedVersion, String &fn, String &drawingExt)
 
TUElementTimedValue * createUnfilledElementTimedValue (SC_SceneCommon *sceneCommon, String &colName)
 
TUTimingTimedValue * createTimingTimedValue (String &timingColumnName, Items &items)
 
void fillTimedValue (TUSeqTimedValue *tv, Items &items)
 
void fillExistingTimedValue (TUSeqTimedValue *tv)
 
bool addLayerToTv (CELIO_Layer &layer, String &timing, TUElementTimedValue *tv, TUScene *scene, int &frame, tu_timedvalue::seq::ReplaceSeqCmd::TUSeqPtrCol &drawings, CO_MacroCommand *macroCmd)
 
bool loadGroupLayers (CELIO_LayerGroup &group, String &timing, TUElementTimedValue *tv, TUScene *scene, int &frame, CO_MacroCommand *macroCmd, tu_timedvalue::seq::ReplaceSeqCmd::TUSeqPtrCol &drawings, bool loadSubGroups=true)
 
MO_Node * addModule (SC_SceneCommon *sceneCommon, TUTimedValue *tv, TUDrawingImportElement &impElem, bool forElement, String &elementName, int alignmentValue=-1, double scale=1.0, bool bitmap=false, String &timingPath=NTR(""))
 
String getNumScannedImagesLabelText ()
 
void setControlsAvailability ()
 
void addScannedImage (CEL_Rep celRep)
 
void error (MSG_Text &msgText)
 
void initFileFormats ()
 
void initElemModulesCombo (String &initialModule)
 
void updateElementModuleCombo ()
 
void initTimingElemModulesCombo (String &initialModule)
 
void initScannerList ()
 
int getAlignmentType ()
 
void getElementInfo (TUElement &elem, String &elemName, String &elemExt)
 
void getImportItemScaleFactor (TUDrawingImportItem &item, double &scaleFactorX, double &scaleFactorY)
 
void getScanImportItemScaleFactor (int itemIndex, double &scaleFactorX, double &scaleFactorY)
 
bool getSelectedElemModule (MO_ElementModule **module, TUElementTimedValue **tv, int &elemId)
 
String getSelectedElemModuleFormat ()
 
bool getSelectedTimingElemModule (MO_ElementModule **module, TUTimingTimedValue **tv)
 
String getCurScanFileFormat ()
 
CA_Types::Premultiply getTransparencyType ()
 
bool isInBitmapSymbol ()
 
bool isSelElemModuleBitmap ()
 
bool isSelTimingElemModuleBitmap ()
 
bool isFileFormatAllowed (String &format)
 
void updateLayout ()
 
void updatePreviewToggle ()
 
void applyVectoOptions (TUPix2vecOptions *vecOptions)
 
bool scannersAvailable ()
 
CEL_Rep importScannedImage (String &imagePath)
 
CEL_Rep rotatePeggedImage (QImage image, TuVectorizeScanInfo::ePegPosition pegPosition)
 
String generateDrawingName (bool)
 
bool isDigits (std::string &str)
 
int generateHoldValue (int &)
 
void updateFrame (TUElementTimedValue *timeValue)
 
void applyInternal ()
 
void loadPreferences ()
 
void savePreferences ()
 
void saveFileListPreference ()
 
void createVectoOptions ()
 
void createSimpleVectoOptions ()
 

Private Attributes

SC_Session * _session
 
SC_SceneCommon * _sceneCommon
 
bool _timingMode
 
int _frameNum
 
int _orderForNewElement
 
int _positionForNewElement
 
int _currentFileFormat
 
String _symbolName
 
StringList _files
 
QLineEdit * _filesLineEdit
 
UI_OKCancelButtons * _okCancelButtons
 
TURadioButton * _createElementRB
 
TURadioButton * _addToElementRB
 
TURadioButton * _createTimingColumnRB
 
TURadioButton * _addToTimingColumnRB
 
TURadioButton * _createOneElementRB
 
TURadioButton * _createElementsBasedOnFilenamesRB
 
TURadioButton * _createOneTimingRB
 
TURadioButton * _createTimingsBasedOnFilenamesRB
 
QLabel * _timingHelpLabel
 
QComboBox * _elemModulesCombo
 
QComboBox * _timingElemModulesCombo
 
QImage _simpleVectoSrcImage
 
QImage _simpleVectoPreviewImage
 
bool _simpleVectoIgnored
 
QTimer _simpleVectoTimer
 
ElemModules _elemModulesMap
 
ElemModules _timingElemModulesMap
 
std::set< MO_Node * > _newModules
 
QGroupBox * _elemGroup
 
QGroupBox * _alignGroup
 
QComboBox * _alignCombo
 
QComboBox * _bitmapLayerAlignCombo
 
QGroupBox * _transparencyGroup
 
QComboBox * _transparencyCombo
 
QComboBox * _bitmapLayerTransparencyCombo
 
CA_Types::Premultiply _transparencyType
 
QGroupBox * _importOptionsGroup
 
TURadioButton * _bitmapAsIsRB
 
TURadioButton * _importBitmapLayerRB
 
TURadioButton * _convertVectorRB
 
QGroupBox * _vectoGroup
 
QTreeWidget * _vectoList
 
QToolButton * _editButton
 
QPushButton * _applyPB
 
WID_PlusMinusButtons * _vectoListButtons
 
WID_VectoPresetWidget * _vectoWidget
 
QCheckBox * _copyCB
 
QCheckBox * _createSymbolCB
 
QGroupBox * _drawingInfoGroup
 
QLabel * _drawingNameLabel
 
QLabel * _holdValueLabel
 
QLabel * _drawingNameEdit
 
QSpinBox * _holdValueEdit
 
QCheckBox * _scanAndAdvanceCB
 
QCheckBox * _overwriteCB
 
QCheckBox * _flipCB
 
QGroupBox * _pagePanningGroup
 
QSlider * _panningSlider
 
QLabel * _panningSliderCurrentValue
 
QLabel * _panningSliderMaxValue
 
QLabel * _panningSliderMinValue
 
TUDrawingImportSimpleVectoOptions_simpleVectoOptions
 
bool _initializing
 
bool _settingControls
 
bool _elementCreated
 
bool _singleSymbolImport
 
bool _isError
 
bool _isItemsReady
 
bool _createSymbol
 
bool _vectorize
 
bool _asBitmapLayer
 
double _bitmapLayerResolutionScaleFactor
 
ImportTable _elementsToImport
 
TUElementMgr * _elementMgr
 
std::auto_ptr< TUPixmapFormatList > _pixmapfmtList
 
String _fileSelectionFilter
 
QLabel * _scannedElementNameLabel
 
QLineEdit * _scannedElementNameEdit
 
QLineEdit * _createdElementNameEdit
 
QLineEdit * _createdTimingNameEdit
 
QLabel * _fileFormatLabel
 
std::auto_ptr
< TUSafeProgressDialog > 
_progress
 
TUTimedValue * _affectedTimedValue
 
TUMessageUnsuspend _msgUnsuspend
 
TUUIMessageBoxParent _msgBoxParent
 
bool _useComposite
 
TUImageScrollView * _previewCtrl
 
TUScaleSliderWithZoom * _previewScaleSlider
 
QPushButton * _previewToggle
 
bool _previewCtrlVectoMode
 
int _previewCtrlHPos
 
int _previewCtrlVPos
 
int _previewCtrlScale
 
int _previewCtrlInitScale
 
bool _isScanning
 
bool _scannersAvailable
 
QComboBox * _scannersCombo
 
QPushButton * _useScannerPB
 
String _albumDir
 
TUScannerAlbumDlg * _scannerAlbum
 
UT_TWAIN * _twain
 
UT_TWAINListener * _twainListener
 
PLUG_ImportHandler * _currentDynamicHandler
 
std::map< PLUG_ImportHandler
*, QWidget * > 
_dynamicWidgetMap
 
QVBoxLayout * _dynamicContainer
 
String _currentDynamicFile
 
SCUI_SimpleScanButtons_simpleScanButtons
 
String _simpleScanElemModuleName
 
int _simpleScanFrame
 
bool _scanMode
 
bool _simpleScanMode
 
bool _simpleScanPreviewMode
 
bool _vectoMode
 
bool _noSymbols
 
bool _is3d
 
bool _isMovie
 
String _drawingName
 
QCheckBox * _convertToOsbCB
 
bool _pref_createNewLayer
 
String _pref_newLayerName
 
bool _pref_vectorize
 
bool _pref_asBitmap
 
bool _pref_addToLayer
 
String _pref_layerName
 
bool _pref_conversionToOsb
 
String _pref_filesString
 
bool _pref_createOneElement
 
bool _pref_createElementsOnFilename
 
bool _pref_overwrite
 
bool _pref_flip
 
bool _pref_scanAndAdvance
 
String _pref_vectorization
 
bool _pref_simpleVectoColour
 
bool _pref_simpleVectoBW
 
double _pref_simpleVectoThreshold
 
double _pref_simpleVectoExpand
 
double _pref_simpleVectoSmooth
 
bool _pref_simpleVectoAutoApply
 
int _pref_alignment
 
int _pref_bitmapLayerAlignment
 
int _pref_transparency
 
int _pref_bitmapLayerTransparency
 
bool _pref_createSymbol
 
String _pref_currentFileFormat
 
String _pref_scanner
 
bool _pref_copyTimings
 
WID_VectoPreset * _currentPreset
 
bool _silentApply
 

Friends

class DrawingImportTwainListener
 

Detailed Description

Import dialog widget for drawing

You can use it in Script Editor only.

Member Typedef Documentation

typedef std::map<String, MO_ElementModule *> ImportDrawingDlg::ElemModules
private
typedef std::map<String, TUDrawingImportElement> ImportDrawingDlg::ImportTable
private
typedef std::vector<TUDrawingImportItem> ImportDrawingDlg::Items
private
typedef std::vector<LayerGroupInfo> ImportDrawingDlg::LayerGroups
private

Member Enumeration Documentation

Enumerator:
IM_DRAWING 
IM_TIMING 
IM_SCAN 
IM_DRAWING_SCENEMACHINE 
IM_3D_MODELS 
IM_MOVIE 

Constructor & Destructor Documentation

ImportDrawingDlg::ImportDrawingDlg ( QWidget *  parent,
SC_Session *  session,
String &  initialModule,
int  frameNum,
int  orderForNewElement,
int  positionForNewElement,
bool  loadPrefs,
ImportMode  importMode = IM_DRAWING,
bool  vectorize = !WHO_Features::hasSimplifiedVectorization() 
)

'initialModule' indicates which element module is the default selection in the "add to existing" drop down lists.

'frameNum' must then be the 1-based number of the frame at which the new drawing names will be added in the designated timed value. If 'timedValueName' is empty or null, 'frameNum' is ignored.

'orderForNewElement' and 'positionForNewElement' must specify where a new timed value would be added, if applicable. Pass -1 for both parameters to specify no preference.

'importMode' can be IM_DRAWING for drawings, IM_TIMING for linked drawings or IM_SCAN for scanning images, IM_3D_MODELS if we import 3d, or IM_MOVIE for movies.

If 'vectorize' is true, the vectorization options will be shown by default.

This dialog is NOT ructed with the flag Qt::WDestructiveClose.

virtual ImportDrawingDlg::~ImportDrawingDlg ( )
virtual

Member Function Documentation

TUDrawingImportElement& ImportDrawingDlg::addElementToImport ( String &  elementName,
String &  drawingExt,
String &  originDir 
)
private
bool ImportDrawingDlg::addLayerToTv ( CELIO_Layer &  layer,
String &  timing,
TUElementTimedValue *  tv,
TUScene *  scene,
int &  frame,
tu_timedvalue::seq::ReplaceSeqCmd::TUSeqPtrCol &  drawings,
CO_MacroCommand *  macroCmd 
)
private

Multilayer image import helpers.

MO_Node* ImportDrawingDlg::addModule ( SC_SceneCommon *  sceneCommon,
TUTimedValue *  tv,
TUDrawingImportElement impElem,
bool  forElement,
String &  elementName,
int  alignmentValue = -1,
double  scale = 1.0,
bool  bitmap = false,
String &  timingPath = NTR("") 
)
private

If 'forElement' is true, then 'tv' is associated with the AT_ElementAttr of the new module. Otherwise, 'tv' is associated with the AT_TimingAttr of the new module.

void ImportDrawingDlg::addScannedImage ( CEL_Rep  celRep)
private

This method is called when an image has been received from a scanner. The CEL_Representation passed as celRep must have been created with operator new. This method becomes owner of the CEL_Representation.

void ImportDrawingDlg::addToElementButtonToggled ( bool  on)
privateslot

We want to change controls availability if these button are toggled.

void ImportDrawingDlg::addToTimingButtonToggled ( bool  on)
privateslot
void ImportDrawingDlg::apply ( )
privateslot

Last part of the import pipeline. We import the image in the scene.

void ImportDrawingDlg::applyInternal ( )
private
void ImportDrawingDlg::applyVectoOptions ( TUPix2vecOptions *  vecOptions)
private
void ImportDrawingDlg::autoApplySimpleVectoOptions ( )
privateslot
void ImportDrawingDlg::buildItems ( bool  showErrorDialog = false)
private
void ImportDrawingDlg::buildItemsInScannerMode ( )
private
void ImportDrawingDlg::cancel ( )
privateslot
void ImportDrawingDlg::checkExtension ( String &  name)
privateslot
virtual void ImportDrawingDlg::closeEvent ( QCloseEvent *  e)
protectedvirtual
bool ImportDrawingDlg::convert3dModelToOSB ( )
private
void ImportDrawingDlg::copyCBToggled ( bool  on)
privateslot
bool ImportDrawingDlg::copyFileToFile ( String  src,
String  dstFilename 
)
private
void ImportDrawingDlg::createElementsBasedOnFilenamesToggled ( bool  on)
privateslot
void ImportDrawingDlg::createOneElementToggled ( bool  on)
privateslot
void ImportDrawingDlg::createOneTimingToggled ( bool  on)
privateslot
void ImportDrawingDlg::createSimpleVectoOptions ( )
private
bool ImportDrawingDlg::createSymbol ( CreateSymbolInfo i_info,
TUDrawingImportElement ie,
TUElement &  o_elem,
TUScene *&  o_scene,
TUElementTimedValue *&  o_sceneTV 
)
private
void ImportDrawingDlg::createTimingsBasedOnFilenamesToggled ( bool  on)
privateslot
TUTimingTimedValue* ImportDrawingDlg::createTimingTimedValue ( String &  timingColumnName,
Items items 
)
private
TUElementTimedValue* ImportDrawingDlg::createUnfilledElementTimedValue ( SC_SceneCommon *  sceneCommon,
String &  colName 
)
private
void ImportDrawingDlg::createVectoOptions ( )
private
void ImportDrawingDlg::doDeletes ( )
private
bool ImportDrawingDlg::doPreImport ( )
private
void ImportDrawingDlg::dynamicContentUpdate ( )
privateslot

Change the value of the current panning level.

void ImportDrawingDlg::editVectorizePreset ( )
privateslot

Open vectorize dialog and let users edit their presets.

void ImportDrawingDlg::elementButtonToggled ( bool  on)
privateslot
void ImportDrawingDlg::enableApply ( )
privateslot
void ImportDrawingDlg::error ( MSG_Text &  msgText)
private

Shows a modal error dialog. If a progress dialog is currently open, destroys it before showing the error dialog.

virtual bool ImportDrawingDlg::event ( QEvent *  )
protectedvirtual
int ImportDrawingDlg::exec ( )
slot
void ImportDrawingDlg::fileError ( String  fname,
MSG_Text &  msg,
bool  showErrorDialog 
)
private
void ImportDrawingDlg::fileSelector ( )
privateslot
void ImportDrawingDlg::filesEntered ( )
privateslot

Build item.

void ImportDrawingDlg::fillExistingTimedValue ( TUSeqTimedValue *  tv)
private
void ImportDrawingDlg::fillTimedValue ( TUSeqTimedValue *  tv,
Items items 
)
private
String ImportDrawingDlg::generateDrawingName ( bool  )
private
int ImportDrawingDlg::generateHoldValue ( int &  )
private
TUTimedValue* ImportDrawingDlg::getAffectedTimedValue ( )

Returns the timed value which was created or augmented by this operation. This method should be called after the call to exec() has returned. The returned pointer may be null if no operation was performed.

int ImportDrawingDlg::getAlignmentType ( )
private
String ImportDrawingDlg::getCurScanFileFormat ( )
private
TUDrawingImportElement* ImportDrawingDlg::getDrawingImportElement ( String &  elementName)
private
void ImportDrawingDlg::getElementInfo ( TUElement &  elem,
String &  elemName,
String &  elemExt 
)
private
void ImportDrawingDlg::getImportFiles ( StringList &  o_fileList)
private
void ImportDrawingDlg::getImportItemScaleFactor ( TUDrawingImportItem item,
double &  scaleFactorX,
double &  scaleFactorY 
)
private
int ImportDrawingDlg::getInsertFrame ( )
slot

The frame where the imported drawing is being inserted.

size_t ImportDrawingDlg::getNumItemsToImport ( )
private
String ImportDrawingDlg::getNumScannedImagesLabelText ( )
private
int ImportDrawingDlg::getOrderForNewElement ( )
slot

Not used.

int ImportDrawingDlg::getPositionForNewElement ( )
slot

Not used.

void ImportDrawingDlg::getScanImportItemScaleFactor ( int  itemIndex,
double &  scaleFactorX,
double &  scaleFactorY 
)
private
bool ImportDrawingDlg::getSelectedElemModule ( MO_ElementModule **  module,
TUElementTimedValue **  tv,
int &  elemId 
)
private
String ImportDrawingDlg::getSelectedElemModuleFormat ( )
private
bool ImportDrawingDlg::getSelectedTimingElemModule ( MO_ElementModule **  module,
TUTimingTimedValue **  tv 
)
private
CA_Types::Premultiply ImportDrawingDlg::getTransparencyType ( )
private
void ImportDrawingDlg::importElement ( TUElementTimedValue *  tv = NULL,
AT_Attr *  attr = NULL 
)
private

Creates a new element if 'existingElementName' is null. Otherwise, adds the imported drawings to the designated element.

static PLUG_ImportEngine* ImportDrawingDlg::importEngine ( )
static
void ImportDrawingDlg::importOneSymbol ( String &  symbolName)
slot

All imported items will be imported into a single symbol.

bool ImportDrawingDlg::importPixmapFile ( String &  srcFilename,
String &  elementName,
String &  timing,
String &  destExtension,
TUSeqTimedValue *  tv,
AT_Attr *  attr 
)
private

Reads the pixmap in the file named by 'srcFilename' and writes it in a file under the directory named by 'dstDir'.

The format of the written file is the format corresponding to the extension 'destExtension'. The source pixmap file does not have to be of the same format. It must not however be a vectorized format. If 'destExtension' is null, then the extension of 'srcFilename' is used as the destination extension.

The name of the written file by is formed from 'dstDir', 'elementName', 'timing' and 'destExtension'.

If the source file is already of the right format, it is copied as is into the destination directory, instead of being read and written by the CELIO_Manager. If an error occurs, _isError becomes true, a modal error dialog is shown and the method returns false. Upon success, the method returns true.

CEL_Rep ImportDrawingDlg::importScannedImage ( String &  imagePath)
private
void ImportDrawingDlg::importTiming ( MO_ElementModule *  existingElemModule = 0,
TUTimingTimedValue *  existingTv = 0 
)
private
void ImportDrawingDlg::initElemModulesCombo ( String &  initialModule)
private

Fills _elemModulesCombo with the names of the scene element modules. If one of those names is equal to 'initialModule', then the corresponding item in the combo box is made current and _addToElementRB is selected. 'initialModule' is allowed to be null.

void ImportDrawingDlg::initFileFormats ( )
private

Determine the bitmap file formats that are available for scanned images and for imported drawings.

void ImportDrawingDlg::initScannerList ( )
private

Fills _scannersCombo with the names of the available scanner devices.

void ImportDrawingDlg::initTimingElemModulesCombo ( String &  initialModule)
private

Fills _elemModulesCombo with the names of the scene element modules. If one of those names is equal to 'initialModule', then the corresponding item in the combo box is made current and _addToElementRB is selected. 'initialModule' is allowed to be null.

bool ImportDrawingDlg::isDigits ( std::string &  str)
private
bool ImportDrawingDlg::isFileFormatAllowed ( String &  format)
private
bool ImportDrawingDlg::isInBitmapSymbol ( )
private
bool ImportDrawingDlg::isSelElemModuleBitmap ( )
private
bool ImportDrawingDlg::isSelTimingElemModuleBitmap ( )
private
bool ImportDrawingDlg::isSingleSymbolImport ( )
slot

Check if import in single symbol is enable.

virtual void ImportDrawingDlg::keyPressEvent ( QKeyEvent *  e)
protectedvirtual
bool ImportDrawingDlg::loadGroupLayers ( CELIO_LayerGroup &  group,
String &  timing,
TUElementTimedValue *  tv,
TUScene *  scene,
int &  frame,
CO_MacroCommand *  macroCmd,
tu_timedvalue::seq::ReplaceSeqCmd::TUSeqPtrCol &  drawings,
bool  loadSubGroups = true 
)
private
void ImportDrawingDlg::loadPreferences ( )
private
String ImportDrawingDlg::makeDrawingFilename ( String &  elementName,
String &  timing,
String &  extension,
String &  dstDir 
)
private

Builds a complete filename for a drawing. Example: makeDrawingFilename("foo", "3a", "Png", "/tmp") returns "/tmp/foo-3a.Png". 'dstDir' is allowed to end with a slash or not.

String ImportDrawingDlg::makeDrawingFilename ( TUSeqTimedValue *  tv,
AT_Attr *  attr,
String &  timing 
)
private
virtual void ImportDrawingDlg::polishEvent ( )
protectedvirtual
void ImportDrawingDlg::populateDynamicContainer ( QWidget *  parent)
private
void ImportDrawingDlg::resetPreview ( )
privateslot

Reset, update or change preview depending of the operation.

CEL_Rep ImportDrawingDlg::rotatePeggedImage ( QImage  image,
TuVectorizeScanInfo::ePegPosition  pegPosition 
)
private
void ImportDrawingDlg::saveFileListPreference ( )
private
void ImportDrawingDlg::savePreferences ( )
private
void ImportDrawingDlg::scalePreview ( int  scaleFactor)
privateslot
void ImportDrawingDlg::scanEnd ( )
privateslot
bool ImportDrawingDlg::scannersAvailable ( )
private
void ImportDrawingDlg::selectModules ( TUGroup *  group,
TUModuleSelectionPredicate predicate,
std::vector< MO_ElementModule * > &  dest 
)

Selects all modules in the scene under the specified group (and its subgroups) that satisfy the given predicate. Pointers to the selected nodes are stored in 'dest'. Does not clear 'dest' initially.

void ImportDrawingDlg::setControlsAvailability ( )
private

Enables or disables the dialog's controls depending on the independent controls.

void ImportDrawingDlg::setFlip ( )
privateslot

Flip the current preview image horizontaly.

void ImportDrawingDlg::setImportFiles ( StringList &  files)
slot

Select all the files that are imported.

void ImportDrawingDlg::setInsertFrame ( int  insertFrame)
slot

Set the frame where the imported drawing is being inserted.

void ImportDrawingDlg::setOrderForNewElement ( int  order)
slot

Not used.

void ImportDrawingDlg::setOverwrite ( bool  )
privateslot

Get the overwrite permission it will change the drawing name and the hold value.

void ImportDrawingDlg::setPanning ( int  )
privateslot
void ImportDrawingDlg::setPositionForNewElement ( int  position)
slot

Not used.

void ImportDrawingDlg::setSingleSymbolImport ( bool  single)
slot

Set the import in single symbole.

void ImportDrawingDlg::silentApply ( int  frame,
String &  file,
String &  drawingName,
String &  columnName 
)
bool ImportDrawingDlg::silentApply ( int  frame,
String &  file,
String &  drawingName 
)
void ImportDrawingDlg::simpleScan ( )
privateslot
void ImportDrawingDlg::simpleScanPreview ( )
privateslot
void ImportDrawingDlg::simpleVectoApply ( )
privateslot

Vectorize the current preview.

void ImportDrawingDlg::simpleVectoTimeout ( )
privateslot
void ImportDrawingDlg::timedValueChanged ( int  item)
privateslot
void ImportDrawingDlg::timingButtonToggled ( bool  on)
privateslot
void ImportDrawingDlg::toggleBitmapAsLayer ( bool  enable)
privateslot
void ImportDrawingDlg::toggleBWSimpleVectoOptions ( bool  enable)
privateslot
void ImportDrawingDlg::toggleCreateSymbol ( bool  enable)
privateslot
void ImportDrawingDlg::togglePreview ( bool  on)
privateslot
void ImportDrawingDlg::toggleSimpleVectoOptions ( bool  enable)
privateslot
void ImportDrawingDlg::toggleVecto ( bool  enable)
privateslot
void ImportDrawingDlg::truncateFileList ( StringList &  i_fileList,
String &  io_strFileList 
)
private
void ImportDrawingDlg::updateElementModuleCombo ( )
private
void ImportDrawingDlg::updateFrame ( TUElementTimedValue *  timeValue)
private
void ImportDrawingDlg::updateLayout ( )
private
void ImportDrawingDlg::updateNumScannedImages ( )
privateslot
void ImportDrawingDlg::updatePreview ( )
privateslot
void ImportDrawingDlg::updatePreviewToggle ( )
private
void ImportDrawingDlg::useScanner ( )
privateslot
bool ImportDrawingDlg::vectorizeFileItem ( TUDrawingImportItem item,
TUSeqTimedValue *  tv,
AT_Attr *  attr 
)
private

Vectorize the drawing file designated by 'item._fullFileName'. If 'dstDir' is null, then the .tvg file is written in the same directory as the original drawing file. If 'dstDir' is not null, it is expected to designate the directory where the .tvg file must be written. 'elementName' will be used as the first part of the resulting file. Returns true for success, false for error (an error dialog is displayed for errors).

bool ImportDrawingDlg::vectorizeFileItem ( TUDrawingImportItem item,
TUSeqTimedValue *  tv,
AT_Attr *  attr,
CELIO_LayerInfo &  layerInfo 
)
private
bool ImportDrawingDlg::vectorizeLayer ( CELIO_Layer &  layer,
TUDrawingImportItem item,
TUSeqTimedValue *  tv,
AT_Attr *  attr 
)
private
GR_CompositeVectorDrawingObj* ImportDrawingDlg::vectorizeScannedItem ( TUDrawingImportItem item,
CEL_Rep  celRep 
)
private

Caller must call delete on returned drawing.

bool ImportDrawingDlg::wasElementCreated ( )
slot

Check if the imported element was created.

bool ImportDrawingDlg::writeImageToDir ( CEL_Rep &  celRep,
GR_CompositeVectorDrawingObj *  vectorizedVersion,
String &  fn,
String &  drawingExt 
)
private

Writes 'vectorizedVersion' if not null; otherwise, writes pixmap designated by 'celRep'.

void ImportDrawingDlg::zoomInPreview ( )
privateslot
void ImportDrawingDlg::zoomOutPreview ( )
privateslot

Friends And Related Function Documentation

friend class DrawingImportTwainListener
friend

Member Data Documentation

TURadioButton * ImportDrawingDlg::_addToElementRB
private
TURadioButton * ImportDrawingDlg::_addToTimingColumnRB
private
TUTimedValue* ImportDrawingDlg::_affectedTimedValue
private
String ImportDrawingDlg::_albumDir
private
QComboBox* ImportDrawingDlg::_alignCombo
private
QGroupBox* ImportDrawingDlg::_alignGroup
private
QPushButton* ImportDrawingDlg::_applyPB
private
bool ImportDrawingDlg::_asBitmapLayer
private
TURadioButton* ImportDrawingDlg::_bitmapAsIsRB
private
QComboBox* ImportDrawingDlg::_bitmapLayerAlignCombo
private
double ImportDrawingDlg::_bitmapLayerResolutionScaleFactor
private
QComboBox* ImportDrawingDlg::_bitmapLayerTransparencyCombo
private
QCheckBox* ImportDrawingDlg::_convertToOsbCB
private
TURadioButton* ImportDrawingDlg::_convertVectorRB
private
QCheckBox* ImportDrawingDlg::_copyCB
private
QLineEdit* ImportDrawingDlg::_createdElementNameEdit
private
QLineEdit* ImportDrawingDlg::_createdTimingNameEdit
private
TURadioButton* ImportDrawingDlg::_createElementRB
private
TURadioButton * ImportDrawingDlg::_createElementsBasedOnFilenamesRB
private
TURadioButton* ImportDrawingDlg::_createOneElementRB
private
TURadioButton* ImportDrawingDlg::_createOneTimingRB
private
bool ImportDrawingDlg::_createSymbol
private
QCheckBox* ImportDrawingDlg::_createSymbolCB
private
TURadioButton * ImportDrawingDlg::_createTimingColumnRB
private
TURadioButton * ImportDrawingDlg::_createTimingsBasedOnFilenamesRB
private
String ImportDrawingDlg::_currentDynamicFile
private
PLUG_ImportHandler* ImportDrawingDlg::_currentDynamicHandler
private
int ImportDrawingDlg::_currentFileFormat
private
WID_VectoPreset* ImportDrawingDlg::_currentPreset
private
QGroupBox* ImportDrawingDlg::_drawingInfoGroup
private
String ImportDrawingDlg::_drawingName
private
QLabel* ImportDrawingDlg::_drawingNameEdit
private
QLabel* ImportDrawingDlg::_drawingNameLabel
private
QVBoxLayout* ImportDrawingDlg::_dynamicContainer
private
std::map<PLUG_ImportHandler *, QWidget *> ImportDrawingDlg::_dynamicWidgetMap
private
QToolButton* ImportDrawingDlg::_editButton
private
bool ImportDrawingDlg::_elementCreated
private
TUElementMgr* ImportDrawingDlg::_elementMgr
private
ImportTable ImportDrawingDlg::_elementsToImport
private
QGroupBox* ImportDrawingDlg::_elemGroup
private
QComboBox* ImportDrawingDlg::_elemModulesCombo
private
ElemModules ImportDrawingDlg::_elemModulesMap
private
QLabel* ImportDrawingDlg::_fileFormatLabel
private
StringList ImportDrawingDlg::_files
private
String ImportDrawingDlg::_fileSelectionFilter
private
QLineEdit* ImportDrawingDlg::_filesLineEdit
private
QCheckBox* ImportDrawingDlg::_flipCB
private
int ImportDrawingDlg::_frameNum
private
QSpinBox* ImportDrawingDlg::_holdValueEdit
private
QLabel* ImportDrawingDlg::_holdValueLabel
private
TURadioButton* ImportDrawingDlg::_importBitmapLayerRB
private
QGroupBox* ImportDrawingDlg::_importOptionsGroup
private
bool ImportDrawingDlg::_initializing
private
bool ImportDrawingDlg::_is3d
private
bool ImportDrawingDlg::_isError
private
bool ImportDrawingDlg::_isItemsReady
private
bool ImportDrawingDlg::_isMovie
private
bool ImportDrawingDlg::_isScanning
private
TUUIMessageBoxParent ImportDrawingDlg::_msgBoxParent
private
TUMessageUnsuspend ImportDrawingDlg::_msgUnsuspend
private
std::set<MO_Node *> ImportDrawingDlg::_newModules
private
bool ImportDrawingDlg::_noSymbols
private
UI_OKCancelButtons* ImportDrawingDlg::_okCancelButtons
private
int ImportDrawingDlg::_orderForNewElement
private
QCheckBox* ImportDrawingDlg::_overwriteCB
private
QGroupBox* ImportDrawingDlg::_pagePanningGroup
private
QSlider* ImportDrawingDlg::_panningSlider
private
QLabel* ImportDrawingDlg::_panningSliderCurrentValue
private
QLabel* ImportDrawingDlg::_panningSliderMaxValue
private
QLabel* ImportDrawingDlg::_panningSliderMinValue
private
std::auto_ptr<TUPixmapFormatList> ImportDrawingDlg::_pixmapfmtList
private
int ImportDrawingDlg::_positionForNewElement
private
bool ImportDrawingDlg::_pref_addToLayer
private
int ImportDrawingDlg::_pref_alignment
private
bool ImportDrawingDlg::_pref_asBitmap
private
int ImportDrawingDlg::_pref_bitmapLayerAlignment
private
int ImportDrawingDlg::_pref_bitmapLayerTransparency
private
bool ImportDrawingDlg::_pref_conversionToOsb
private
bool ImportDrawingDlg::_pref_copyTimings
private
bool ImportDrawingDlg::_pref_createElementsOnFilename
private
bool ImportDrawingDlg::_pref_createNewLayer
private
bool ImportDrawingDlg::_pref_createOneElement
private
bool ImportDrawingDlg::_pref_createSymbol
private
String ImportDrawingDlg::_pref_currentFileFormat
private
String ImportDrawingDlg::_pref_filesString
private
bool ImportDrawingDlg::_pref_flip
private
String ImportDrawingDlg::_pref_layerName
private
String ImportDrawingDlg::_pref_newLayerName
private
bool ImportDrawingDlg::_pref_overwrite
private
bool ImportDrawingDlg::_pref_scanAndAdvance
private
String ImportDrawingDlg::_pref_scanner
private
bool ImportDrawingDlg::_pref_simpleVectoAutoApply
private
bool ImportDrawingDlg::_pref_simpleVectoBW
private
bool ImportDrawingDlg::_pref_simpleVectoColour
private
double ImportDrawingDlg::_pref_simpleVectoExpand
private
double ImportDrawingDlg::_pref_simpleVectoSmooth
private
double ImportDrawingDlg::_pref_simpleVectoThreshold
private
int ImportDrawingDlg::_pref_transparency
private
String ImportDrawingDlg::_pref_vectorization
private
bool ImportDrawingDlg::_pref_vectorize
private
TUImageScrollView* ImportDrawingDlg::_previewCtrl
private
int ImportDrawingDlg::_previewCtrlHPos
private
int ImportDrawingDlg::_previewCtrlInitScale
private
int ImportDrawingDlg::_previewCtrlScale
private
bool ImportDrawingDlg::_previewCtrlVectoMode
private
int ImportDrawingDlg::_previewCtrlVPos
private
TUScaleSliderWithZoom* ImportDrawingDlg::_previewScaleSlider
private
QPushButton* ImportDrawingDlg::_previewToggle
private
std::auto_ptr<TUSafeProgressDialog> ImportDrawingDlg::_progress
private
QCheckBox* ImportDrawingDlg::_scanAndAdvanceCB
private
bool ImportDrawingDlg::_scanMode
private
QLineEdit* ImportDrawingDlg::_scannedElementNameEdit
private
QLabel* ImportDrawingDlg::_scannedElementNameLabel
private
TUScannerAlbumDlg* ImportDrawingDlg::_scannerAlbum
private
bool ImportDrawingDlg::_scannersAvailable
private
QComboBox* ImportDrawingDlg::_scannersCombo
private
SC_SceneCommon* ImportDrawingDlg::_sceneCommon
private
SC_Session* ImportDrawingDlg::_session
private
bool ImportDrawingDlg::_settingControls
private
bool ImportDrawingDlg::_silentApply
private
SCUI_SimpleScanButtons* ImportDrawingDlg::_simpleScanButtons
private
String ImportDrawingDlg::_simpleScanElemModuleName
private
int ImportDrawingDlg::_simpleScanFrame
private
bool ImportDrawingDlg::_simpleScanMode
private
bool ImportDrawingDlg::_simpleScanPreviewMode
private
bool ImportDrawingDlg::_simpleVectoIgnored
private
TUDrawingImportSimpleVectoOptions* ImportDrawingDlg::_simpleVectoOptions
private
QImage ImportDrawingDlg::_simpleVectoPreviewImage
private
QImage ImportDrawingDlg::_simpleVectoSrcImage
private
QTimer ImportDrawingDlg::_simpleVectoTimer
private
bool ImportDrawingDlg::_singleSymbolImport
private
String ImportDrawingDlg::_symbolName
private
QComboBox* ImportDrawingDlg::_timingElemModulesCombo
private
ElemModules ImportDrawingDlg::_timingElemModulesMap
private
QLabel* ImportDrawingDlg::_timingHelpLabel
private
bool ImportDrawingDlg::_timingMode
private
QComboBox* ImportDrawingDlg::_transparencyCombo
private
QGroupBox* ImportDrawingDlg::_transparencyGroup
private
CA_Types::Premultiply ImportDrawingDlg::_transparencyType
private
UT_TWAIN* ImportDrawingDlg::_twain
private
UT_TWAINListener* ImportDrawingDlg::_twainListener
private
bool ImportDrawingDlg::_useComposite
private
QPushButton* ImportDrawingDlg::_useScannerPB
private
QGroupBox* ImportDrawingDlg::_vectoGroup
private
QTreeWidget* ImportDrawingDlg::_vectoList
private
WID_PlusMinusButtons* ImportDrawingDlg::_vectoListButtons
private
bool ImportDrawingDlg::_vectoMode
private
bool ImportDrawingDlg::_vectorize
private
WID_VectoPresetWidget* ImportDrawingDlg::_vectoWidget
private

Property Documentation

int ImportDrawingDlg::insertFrame
readwrite
int ImportDrawingDlg::orderForNewElement
readwrite
int ImportDrawingDlg::positionForNewElement
readwrite
bool ImportDrawingDlg::singleSymbolImport
readwrite

The documentation for this class was generated from the following file: