Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
3f30d180
Commit
3f30d180
authored
4 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
Move single line method's implementation to CPP file in DesignerHelper
parent
7eb1b4d2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/coregui/Views/SampleDesigner/DesignerHelper.cpp
+100
-0
100 additions, 0 deletions
GUI/coregui/Views/SampleDesigner/DesignerHelper.cpp
GUI/coregui/Views/SampleDesigner/DesignerHelper.h
+20
-26
20 additions, 26 deletions
GUI/coregui/Views/SampleDesigner/DesignerHelper.h
with
120 additions
and
26 deletions
GUI/coregui/Views/SampleDesigner/DesignerHelper.cpp
+
100
−
0
View file @
3f30d180
...
...
@@ -139,6 +139,16 @@ QPixmap DesignerHelper::getPixmapParticle()
return
pixmap
;
}
QColor
DesignerHelper
::
getRandomColor
()
{
return
QColor
(
qrand
()
%
256
,
qrand
()
%
256
,
qrand
()
%
256
);
}
bool
DesignerHelper
::
sort_layers
(
QGraphicsItem
*
left
,
QGraphicsItem
*
right
)
{
return
left
->
y
()
<
right
->
y
();
}
// non-linear conversion of layer's thickness in nanometers to screen size to have reasonable
// graphics representation
int
DesignerHelper
::
nanometerToScreen
(
double
nanometer
)
...
...
@@ -221,12 +231,102 @@ int DesignerHelper::getHeaderFontSize()
#endif
}
int
DesignerHelper
::
getDefaultLayerWidth
()
{
return
m_default_layer_width
;
}
int
DesignerHelper
::
getDefaultLayerHeight
()
{
return
m_default_layer_height
;
}
QColor
DesignerHelper
::
getDefaultLayerColor
()
{
return
QColor
(
Qt
::
lightGray
);
}
int
DesignerHelper
::
getDefaultMultiLayerWidth
()
{
return
m_default_layer_width
*
1.15
;
}
int
DesignerHelper
::
getDefaultMultiLayerHeight
()
{
return
m_default_layer_height
;
}
QRectF
DesignerHelper
::
getDefaultMultiLayerRect
()
{
return
QRectF
(
0
,
0
,
DesignerHelper
::
getDefaultMultiLayerWidth
(),
DesignerHelper
::
getDefaultMultiLayerHeight
());
}
int
DesignerHelper
::
getDefaultParticleLayoutWidth
()
{
return
m_default_layer_height
*
3.5
;
}
int
DesignerHelper
::
getDefaultParticleLayoutHeight
()
{
return
m_default_layer_height
*
4.5
;
}
int
DesignerHelper
::
getDefaultInterferenceFunctionWidth
()
{
return
m_default_layer_height
*
4.5
;
}
int
DesignerHelper
::
getDefaultInterferenceFunctionHeight
()
{
return
m_default_layer_height
*
4
;
}
int
DesignerHelper
::
getDefaultParticleWidth
()
{
return
m_default_layer_height
*
3.5
;
}
int
DesignerHelper
::
getDefaultParticleHeight
()
{
return
m_default_layer_height
*
4
;
}
QColor
DesignerHelper
::
getDefaultParticleColor
()
{
return
QColor
(
210
,
223
,
237
);
}
int
DesignerHelper
::
getDefaultTransformationWidth
()
{
return
m_default_layer_height
*
4
;
}
int
DesignerHelper
::
getDefaultTransformationHeight
()
{
return
m_default_layer_height
*
2
;
}
QColor
DesignerHelper
::
getDefaultTransformationColor
()
{
return
QColor
(
145
,
50
,
220
);
}
int
DesignerHelper
::
getDefaultMaterialWidth
()
{
return
m_default_layer_height
*
1.2
;
}
int
DesignerHelper
::
getDefaultMaterialHeight
()
{
return
m_default_layer_height
*
1.2
;
}
QColor
DesignerHelper
::
getDefaultMaterialColor
()
{
return
QColor
(
qrand
()
%
256
,
qrand
()
%
256
,
qrand
()
%
256
);
}
int
DesignerHelper
::
getSectionFontSize
()
{
#ifdef Q_OS_MAC
...
...
This diff is collapsed.
Click to expand it.
GUI/coregui/Views/SampleDesigner/DesignerHelper.h
+
20
−
26
View file @
3f30d180
...
...
@@ -45,34 +45,31 @@ public:
TRANSFORMATION
,
};
static
int
getDefaultLayerWidth
()
{
return
m_default_layer_width
;
}
static
int
getDefaultLayerHeight
()
{
return
m_default_layer_height
;
}
static
QColor
getDefaultLayerColor
()
{
return
QColor
(
Qt
::
lightGray
);
}
static
int
getDefaultLayerWidth
()
;
static
int
getDefaultLayerHeight
()
;
static
QColor
getDefaultLayerColor
()
;
static
int
getDefaultMultiLayerWidth
()
{
return
m_default_layer_width
*
1.15
;
}
static
int
getDefaultMultiLayerHeight
()
{
return
m_default_layer_height
;
}
static
int
getDefaultMultiLayerWidth
()
;
static
int
getDefaultMultiLayerHeight
()
;
static
QRectF
getDefaultMultiLayerRect
();
static
int
getDefaultParticleLayoutWidth
()
{
return
m_default_layer_height
*
3.5
;
}
static
int
getDefaultParticleLayoutHeight
()
{
return
m_default_layer_height
*
4.5
;
}
static
int
getDefaultParticleLayoutWidth
()
;
static
int
getDefaultParticleLayoutHeight
()
;
static
int
getDefaultInterferenceFunctionWidth
()
{
return
m_default_layer_height
*
4.5
;
}
static
int
getDefaultInterferenceFunctionHeight
()
{
return
m_default_layer_height
*
4
;
}
static
int
getDefaultInterferenceFunctionWidth
()
;
static
int
getDefaultInterferenceFunctionHeight
()
;
static
int
getDefaultParticleWidth
()
{
return
m_default_layer_height
*
3.5
;
}
static
int
getDefaultParticleHeight
()
{
return
m_default_layer_height
*
4
;
}
static
QColor
getDefaultParticleColor
()
{
return
QColor
(
210
,
223
,
237
);
}
static
int
getDefaultParticleWidth
()
;
static
int
getDefaultParticleHeight
()
;
static
QColor
getDefaultParticleColor
()
;
static
int
getDefaultTransformationWidth
()
{
return
m_default_layer_height
*
4
;
}
static
int
getDefaultTransformationHeight
()
{
return
m_default_layer_height
*
2
;
}
static
QColor
getDefaultTransformationColor
()
{
return
QColor
(
145
,
50
,
220
);
}
static
int
getDefaultTransformationWidth
()
;
static
int
getDefaultTransformationHeight
()
;
static
QColor
getDefaultTransformationColor
()
;
static
int
getDefaultMaterialWidth
()
{
return
m_default_layer_height
*
1.2
;
}
static
int
getDefaultMaterialHeight
()
{
return
m_default_layer_height
*
1.2
;
}
static
QColor
getDefaultMaterialColor
()
{
return
QColor
(
qrand
()
%
256
,
qrand
()
%
256
,
qrand
()
%
256
);
}
static
int
getDefaultMaterialWidth
();
static
int
getDefaultMaterialHeight
();
static
QColor
getDefaultMaterialColor
();
static
QGradient
getLayerGradient
(
const
QColor
&
color
,
const
QRectF
&
rect
);
static
QGradient
getDecorationGradient
(
const
QColor
&
color
,
const
QRectF
&
rect
);
...
...
@@ -84,13 +81,10 @@ public:
static
QPixmap
getPixmapInterferenceFunction
();
static
QPixmap
getPixmapParticle
();
static
QColor
getRandomColor
()
{
return
QColor
(
qrand
()
%
256
,
qrand
()
%
256
,
qrand
()
%
256
);
}
static
QColor
getRandomColor
()
;
//! sort graphics item according they y-coordinate
static
bool
sort_layers
(
QGraphicsItem
*
left
,
QGraphicsItem
*
right
)
{
return
left
->
y
()
<
right
->
y
();
}
static
bool
sort_layers
(
QGraphicsItem
*
left
,
QGraphicsItem
*
right
);
//! non-linear conversion of layer's thickness in nanometers to screen size
//! to have reasonable graphics representation of layer in the form of QRect
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment