Moved export functions to model.

This commit is contained in:
leo 2014-10-10 23:53:08 +00:00
parent a6a69b7661
commit f9b0cbbc05
7 changed files with 1040 additions and 1045 deletions

View file

@ -100,7 +100,7 @@ struct lcPropertiesDialogOptions
String Title;
bool SetDefault;
lcArray<lcPiecesUsedEntry> PartsUsed;
lcArray<lcPartsListEntry> PartsList;
};
struct lcArrayDialogOptions

View file

@ -16,6 +16,7 @@ class lcPiece;
class lcCamera;
class lcLight;
class lcGroup;
class PieceInfo;
class lcVector2;
class lcVector3;

File diff suppressed because it is too large Load diff

View file

@ -100,6 +100,13 @@ struct lcModelHistoryEntry
QString Description;
};
struct lcPartsListEntry
{
PieceInfo* Info;
int ColorIndex;
int Count;
};
class lcModel
{
public:
@ -153,6 +160,7 @@ public:
lcObject* GetFocusObject() const;
bool GetSelectionCenter(lcVector3& Center) const;
bool GetPiecesBoundingBox(float BoundingBox[6]) const;
void GetPartsList(lcArray<lcPartsListEntry>& PartsList) const;
void FocusOrDeselectObject(const lcObjectSection& ObjectSection);
void ClearSelectionAndSetFocus(lcObject* Object, lcuint32 Section);
@ -190,6 +198,12 @@ public:
void UpdateRollTool(lcCamera* Camera, float Mouse);
void ZoomRegionToolClicked(lcCamera* Camera, const lcVector3* Points, float RatioX, float RatioY);
void Export3DStudio() const;
void ExportBrickLink() const;
void ExportCSV() const;
void ExportPOVRay() const;
void ExportWavefront() const;
protected:
void DeleteModel();
void DeleteHistory();
@ -222,7 +236,7 @@ protected:
lcArray<lcModelHistoryEntry*> mUndoHistory;
lcArray<lcModelHistoryEntry*> mRedoHistory;
Q_DECLARE_TR_FUNCTIONS(lcModel)
Q_DECLARE_TR_FUNCTIONS(lcModel);
};
#endif // _LC_MODEL_H_

File diff suppressed because it is too large Load diff

View file

@ -41,13 +41,6 @@ struct LC_FILEENTRY
char FileName[LC_MAXPATH];
};
struct lcPiecesUsedEntry
{
PieceInfo* Info;
int ColorIndex;
int Count;
};
enum lcObjectProperty
{
LC_PIECE_PROPERTY_POSITION,
@ -96,7 +89,6 @@ public:
public:
void LoadDefaults();
void GetPiecesUsed(lcArray<lcPiecesUsedEntry>& PiecesUsed) const;
void CreateImages(Image* images, int width, int height, lcStep from, lcStep to, bool hilite);
void Render(View* view, bool bToMemory);
lcGroup* AddGroup(lcGroup* Parent);
@ -118,8 +110,6 @@ protected:
void RenderSceneObjects(View* view);
void CreateHTMLPieceList(FILE* f, lcStep Step, bool bImages, const char* ext);
void Export3DStudio();
void ExportPOVRay(lcFile& File);
void ZoomExtents(int FirstView, int LastView);
bool DoSave(const char* FileName);

View file

@ -55,7 +55,7 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget *parent, void *data) :
ui->ambientColorButton->setIcon(pix);
lcPiecesLibrary *library = lcGetPiecesLibrary();
lcArray<lcPiecesUsedEntry>& partsUsed = options->PartsUsed;
lcArray<lcPartsListEntry>& partsUsed = options->PartsList;
QStringList horizontalLabels, partNames;
bool *colorsUsed = new bool[gNumUserColors];