Skip to content

Commit f08d5da

Browse files
Merge pull request #28 from PauloCarvalhoRJ/IndicatorKrigingCategorical
Indicator kriging categorical
2 parents 8afba9c + b2d4677 commit f08d5da

Some content is hidden

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

58 files changed

+2319
-79
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# These files are kept by Qt Creator and does not actually belong to the source file set.
22
GammaRay.pro.user*
3+
4+
# Temporary file created by Microsoft Word when editing GammaRayManual.docx
5+
docs/~*.docx

GammaRay.pro

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ SOURCES += main.cpp\
118118
scripting.cpp \
119119
gslib/gslibparams/gslibparvmodel.cpp \
120120
gslib/gslibparams/widgets/widgetgslibparvmodel.cpp \
121+
domain/triads.cpp \
122+
domain/categorydefinition.cpp \
123+
triadseditordialog.cpp \
124+
domain/univariatecategoryclassification.cpp \
125+
widgets/categoryselector.cpp \
126+
widgets/intervalandcategorywidget.cpp \
121127
spatialindex/spatialindexpoints.cpp
122128

123129
HEADERS += mainwindow.h \
@@ -218,6 +224,12 @@ HEADERS += mainwindow.h \
218224
exprtk.hpp \
219225
gslib/gslibparams/gslibparvmodel.h \
220226
gslib/gslibparams/widgets/widgetgslibparvmodel.h \
227+
domain/triads.h \
228+
domain/categorydefinition.h \
229+
triadseditordialog.h \
230+
domain/univariatecategoryclassification.h \
231+
widgets/categoryselector.h \
232+
widgets/intervalandcategorywidget.h \
221233
spatialindex/spatialindexpoints.h
222234

223235
FORMS += mainwindow.ui \
@@ -263,7 +275,10 @@ FORMS += mainwindow.ui \
263275
valuespairsdialog.ui \
264276
indicatorkrigingdialog.ui \
265277
widgets/fileselectorwidget.ui \
266-
gslib/gslibparams/widgets/widgetgslibparvmodel.ui
278+
gslib/gslibparams/widgets/widgetgslibparvmodel.ui \
279+
triadseditordialog.ui \
280+
widgets/categoryselector.ui \
281+
widgets/intervalandcategorywidget.ui
267282

268283
# The Boost include path.
269284
BOOST_INSTALL = $$(BOOST_ROOT)
@@ -275,7 +290,7 @@ INCLUDEPATH += $$BOOST_INSTALL
275290
# The application version
276291
# Don't forget to update the Util::importSettingsFromPreviousVersion() method to
277292
# enable the import of registry/user settings of previous versions.
278-
VERSION = 1.2.1
293+
VERSION = 1.3
279294

280295
# Define a preprocessor macro so we can get the application version in application code.
281296
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

LICENSE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Authors:
77
Original: Paulo R. M. de Carvalho (paulo.r.m.carvalho@gmail.com)
88
Code contributors:
99

10-
=========================================Complete transcription of the Licence====================================================
10+
=========================================Complete transcription of the License====================================================
1111

1212
License
1313

@@ -30,6 +30,7 @@ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE B
3030
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
3131

3232
2. Fair Dealing Rights.
33+
3334
Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3435

3536
3. License Grant.

art/catdef16x16.png

287 Bytes
Loading

art/catuniclass16x16.png

230 Bytes
Loading

art/faciesmap16x16.png

282 Bytes
Loading

art/iconsHD/faciesmap32.png

430 Bytes
Loading

docs/GammaRayManual.docx

584 KB
Binary file not shown.

domain/attribute.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ class Attribute : public ProjectComponent
1717
*/
1818
File* getContainingFile();
1919

20+
/**
21+
* Returns the GEO-EAS index passed in the constructor,
22+
* so this is not necessarily read from a GEO-EAS file.
23+
*/
24+
int getAttributeGEOEASgivenIndex(){ return _index; }
25+
2026
// ProjectComponent interface
2127
public:
2228
QString getName();

domain/categorydefinition.cpp

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#include "categorydefinition.h"
2+
#include "gslib/gslibparameterfiles/gslibparamtypes.h"
3+
#include "gslib/gslibparams/widgets/widgetgslibparmultivaluedfixed.h"
4+
5+
CategoryDefinition::CategoryDefinition(QString path) : IntIntQStringTriplets ( path )
6+
{
7+
}
8+
9+
CategoryDefinition::~CategoryDefinition()
10+
{
11+
//TODO: delete the objects in m_createdParameters here.
12+
}
13+
14+
void CategoryDefinition::save(QTextStream *txt_stream)
15+
{
16+
(*txt_stream) << this->getFileType() << ":" << this->getFileName() << '\n';
17+
}
18+
19+
QWidget *CategoryDefinition::createContentElementWidget()
20+
{
21+
//create a parameter set with default values to represent a triplet of code, color, name.
22+
GSLibParMultiValuedFixed* par = new GSLibParMultiValuedFixed("","","");
23+
GSLibParInt *pint = new GSLibParInt("","","");
24+
int num_cats = m_stashOfCreatedParameters.size() + 1;
25+
pint->_value = num_cats;
26+
par->_parameters.append( pint );
27+
GSLibParColor *pcol = new GSLibParColor("","","");
28+
pcol->_color_code = num_cats % 25; //max. color code is 24.
29+
par->_parameters.append( pcol );
30+
GSLibParString *pstr = new GSLibParString("","","");
31+
pstr->_value = QString("Category ") + QString::number( num_cats );
32+
par->_parameters.append( pstr );
33+
//store the pointer to delete some time later.
34+
m_stashOfCreatedParameters.append( par );
35+
//return the widget tailored for the data types of the triplet.
36+
return par->getWidget();
37+
}
38+
39+
QWidget *CategoryDefinition::createWidgetFilledWithContentElement(uint iContent)
40+
{
41+
//create a parameter set with the code, color and name values.
42+
GSLibParMultiValuedFixed* par = new GSLibParMultiValuedFixed("","","");
43+
GSLibParInt *pint = new GSLibParInt("","","");
44+
pint->_value = get1stValue( iContent ); // the category code
45+
par->_parameters.append( pint );
46+
GSLibParColor *pcol = new GSLibParColor("","","");
47+
pcol->_color_code = get2ndValue( iContent ); // the GSLib color code
48+
par->_parameters.append( pcol );
49+
GSLibParString *pstr = new GSLibParString("","","");
50+
pstr->_value = get3rdValue( iContent ); //the Category name
51+
par->_parameters.append( pstr );
52+
//store the pointer to delete some time later.
53+
m_stashOfCreatedParameters.append( par );
54+
//return the widget tailored for the data types of the triplet.
55+
return par->getWidget();
56+
}
57+
58+
void CategoryDefinition::addContentElementFromWidget(QWidget *w)
59+
{
60+
//surely the widget is a WidgetGSLibParMultiValuedFixed.
61+
WidgetGSLibParMultiValuedFixed *widget = (WidgetGSLibParMultiValuedFixed*)w;
62+
63+
//build a parameter set adequate to read the user-entered values in the passed widget.
64+
GSLibParMultiValuedFixed* par = new GSLibParMultiValuedFixed("","","");
65+
par->_parameters.append( new GSLibParInt("","","") );
66+
par->_parameters.append( new GSLibParColor("","","") );
67+
par->_parameters.append( new GSLibParString("","","") );
68+
69+
//read the values from the widget into the parameter set object.
70+
widget->updateValue( par );
71+
72+
//add the triplet of the values read.
73+
addTriplet( ((GSLibParInt*)par->_parameters[0])->_value,
74+
((GSLibParColor*)par->_parameters[1])->_color_code,
75+
((GSLibParString*)par->_parameters[2])->_value );
76+
77+
//store the parameter set pointer to delete some time later.
78+
m_stashOfCreatedParameters.append( par );
79+
}

0 commit comments

Comments
 (0)