Skip to content

Commit 6840739

Browse files
author
dvmorris@gmail.com
committed
somehow the svn repo got deleted... sorry about that.
0 parents  commit 6840739

File tree

354 files changed

+127261
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+127261
-0
lines changed

topmodx/BasicsMode.cc

Lines changed: 517 additions & 0 deletions
Large diffs are not rendered by default.

topmodx/BasicsMode.hh

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
*
3+
* ***** BEGIN GPL LICENSE BLOCK *****
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License
7+
* as published by the Free Software Foundation; either version 2
8+
* of the License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software Foundation,
17+
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18+
*
19+
* The Original Code is Copyright (C) 2005 by xxxxxxxxxxxxxx
20+
* All rights reserved.
21+
*
22+
* The Original Code is: all of this file.
23+
*
24+
* Contributor(s): none yet.
25+
*
26+
* ***** END GPL LICENSE BLOCK *****
27+
*/
28+
29+
/****************************************************************************
30+
**
31+
**
32+
****************************************************************************/
33+
34+
#ifndef BASICSMODE_H
35+
#define BASICSMODE_H
36+
37+
#include <QWidget>
38+
#include <QPushButton>
39+
#include <QGridLayout>
40+
41+
/*!
42+
\file BasicsMode.hh
43+
\brief Definition of the BasicsMode class
44+
45+
\see BasicsMode
46+
*/
47+
48+
#include "MainWindow.hh"
49+
50+
class MainWindow;
51+
52+
class QComboBox;
53+
class QPushButton;
54+
class QGroupBox;
55+
class QCheckBox;
56+
class QLabel;
57+
58+
class BasicsMode : public QWidget {
59+
Q_OBJECT
60+
61+
public:
62+
BasicsMode(QWidget *parent, QShortcutManager *sm, QWidget *actionList);
63+
void addActions(QActionGroup *actionGroup, QToolBar *toolBar, QStackedWidget *stackedWidget);
64+
QMenu* getMenu();
65+
void retranslateUi();
66+
67+
QAction *mInsertEdgeAction;
68+
QAction *mDeleteEdgeAction;
69+
QAction *mCollapseEdgeAction;
70+
QAction *mSubdivideEdgeAction;
71+
QAction *mConnectEdgesAction;
72+
QAction *mSpliceCornersAction;
73+
QAction *mTransformsAction;
74+
QAction *mSelectionOptionsAction;
75+
76+
QWidget *mInsertEdgeWidget;
77+
QWidget *mDeleteEdgeWidget;
78+
QWidget *mCollapseEdgeWidget;
79+
QWidget *mSubdivideEdgeWidget;
80+
QWidget *mConnectEdgesWidget;
81+
QWidget *mSpliceCornersWidget;
82+
QWidget *mTransformsWidget;
83+
QWidget *mSelectionOptionsWidget;
84+
85+
QGridLayout *mInsertEdgeLayout;
86+
QGridLayout *mDeleteEdgeLayout;
87+
QGridLayout *mCollapseEdgeLayout;
88+
QGridLayout *mSubdivideEdgeLayout;
89+
QGridLayout *mConnectEdgesLayout;
90+
QGridLayout *mSpliceCornersLayout;
91+
QGridLayout *mTransformsLayout;
92+
QGridLayout *mSelectionOptionsLayout;
93+
94+
protected:
95+
void setupInsertEdge();
96+
void setupDeleteEdge();
97+
void setupCollapseEdge();
98+
void setupSubdivideEdge();
99+
void setupConnectEdges();
100+
void setupSpliceCorners();
101+
void setupTransforms();
102+
void setupSelectionOptions();
103+
QDoubleSpinBox *createDoubleSpinBox(QGridLayout *layout, QLabel *label, QString s, double low, double high, double step, double value, double decimals, int row, int col);
104+
105+
106+
private:
107+
108+
QWidget *mParent;
109+
QMenu *mBasicsMenu;
110+
111+
QLabel *numSubdivsLabel;
112+
QDoubleSpinBox *numSubdivsSpinBox;
113+
QLabel *transformLabel;
114+
QLabel *xPosLabel;
115+
QLabel *yPosLabel;
116+
QLabel *zPosLabel;
117+
QLabel *scaleLabel;
118+
QLabel *xScaleLabel;
119+
QLabel *yScaleLabel;
120+
QLabel *zScaleLabel;
121+
122+
QLabel *noOptionsInsertEdgeLabel;
123+
QCheckBox *cleanupDeleteEdgeCheckBox;
124+
QLabel *noOptionsCollapseEdgeLabel;
125+
QLabel *noOptionsConnectEdgesLabel;
126+
QLabel *noOptionsSpliceCornersLabel;
127+
128+
QPushButton *freezeTransformsButton;
129+
130+
//transform spinboxes
131+
QDoubleSpinBox *xScaleSpinBox;
132+
QDoubleSpinBox *yScaleSpinBox;
133+
QDoubleSpinBox *zScaleSpinBox;
134+
QDoubleSpinBox *xPosSpinBox;
135+
QDoubleSpinBox *yPosSpinBox;
136+
QDoubleSpinBox *zPosSpinBox;
137+
138+
QLabel *mFaceAreaToleranceLabel;
139+
QDoubleSpinBox *mFaceAreaToleranceSpinBox;
140+
141+
QLabel *mSplit2ValenceVertexOffsetLabel;
142+
QDoubleSpinBox *mSplit2ValenceVertexOffsetSpinBox;
143+
144+
public slots:
145+
void freezeTransforms();
146+
147+
void triggerInsertEdge();
148+
void triggerDeleteEdge();
149+
void triggerCollapseEdge();
150+
void triggerSubdivideEdge();
151+
void triggerConnectEdges();
152+
void triggerSpliceCorners();
153+
void triggerTransforms();
154+
void triggerSelectionOptions();
155+
};
156+
157+
#endif

topmodx/CgData.cc

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
*
3+
* ***** BEGIN GPL LICENSE BLOCK *****
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License
7+
* as published by the Free Software Foundation; either version 2
8+
* of the License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software Foundation,
17+
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18+
*
19+
* The Original Code is Copyright (C) 2005 by xxxxxxxxxxxxxx
20+
* All rights reserved.
21+
*
22+
* The Original Code is: all of this file.
23+
*
24+
* Contributor(s): none yet.
25+
*
26+
* ***** END GPL LICENSE BLOCK *****
27+
*
28+
* Short description of this file
29+
*
30+
* name of .hh file containing function prototypes
31+
*
32+
*/
33+
34+
/*
35+
*
36+
*-----------------------------------------------------
37+
* File: $RCSfile: CgData.cc,v $
38+
* Date modified: $Date: 2007/02/13 19:37:54 $
39+
* Version: $Revision: 1.1 $
40+
*-----------------------------------------------------
41+
*
42+
* Copyright (C) 2007 Original Author(s)
43+
*
44+
* Original Author(s):
45+
* Stuart T. Tett <stuart@tett.net>
46+
*
47+
* This program is free software; you can redistribute it and/or modify
48+
* it under the terms of the GNU General Public License as published by
49+
* the Free Software Foundation; either version 2 of the License, or
50+
* (at your option) any later version.
51+
*
52+
* This program is distributed in the hope that it will be useful,
53+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
54+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+
* GNU General Public License for more details.
56+
*
57+
* You should have received a copy of the GNU General Public License
58+
* along with this program; if not, write to the Free Software
59+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
60+
*
61+
*/
62+
63+
#include "CgData.hh"
64+
65+
#ifdef GPU_OK
66+
67+
namespace Cg {
68+
69+
/*!
70+
* \brief private Constructor
71+
*/
72+
CgData::CgData(){
73+
74+
}
75+
76+
CgData* CgData::mInstance = 0; //!< initialize the singleton pointer to 0
77+
78+
/*!
79+
* \brief ensures only 1 instance (singleton)
80+
*/
81+
CgData* CgData::instance( ) {
82+
if ( !mInstance )
83+
mInstance = new CgData;
84+
return mInstance;
85+
}
86+
87+
void checkCgError( CGcontext &context, int id ) {
88+
CGerror err = cgGetError();
89+
if (err != CG_NO_ERROR) {
90+
printf("CG error %d: %s\n", id, cgGetErrorString(err));
91+
if ( context ) {
92+
printf("%s\n", cgGetLastListing( context ));
93+
}
94+
}
95+
};
96+
97+
void checkForCgError(const char *situation) {
98+
CGerror error;
99+
const char *string = cgGetLastErrorString(&error);
100+
101+
if (error != CG_NO_ERROR) {
102+
printf("%s: %s\n", situation, string);
103+
if (error == CG_COMPILER_ERROR) {
104+
printf("%s\n", cgGetLastListing(CgData::instance()->context));
105+
}
106+
// exit(1);
107+
}
108+
}
109+
110+
111+
} // end namespace Cg
112+
113+
#endif // GPU_OK

0 commit comments

Comments
 (0)