Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
25886188
Commit
25886188
authored
Jul 22, 2020
by
Mathieu Tillet
Browse files
Refactoring, doxygen doc and more comments
parent
da0041e8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Shape2D.h
View file @
25886188
...
...
@@ -303,16 +303,21 @@ protected:
};
/**
* A sector: area defined by an inner and an outer arcs of circle, interrupted
* at angles startAngle and endAngle.
* A sector: area defined by two concentric arcs of circle, of radii innerRadius
* and outerRadius, interrupted at angles startAngle and endAngle.
* It is basically a slice of a circular ring.
*
* The constructor takes a center QPointF property, representing the center of
* the circles, the 2 limit angles, and the 2 radii for the circles.
*
* startAngle and endAngle are expressed in radians within the object, ranging
* from 0 to 2*pi, and are only changed to degrees for the user.
*
* The constructor takes a center QPoint property, 2 angles, and 2 widths for
* the two circles.
*/
class
Shape2DSector
:
public
Shape2D
{
public:
Shape2DSector
(
double
inner
_r
adius
,
double
outer
_r
adius
,
double
start
_a
ngle
,
double
end
_a
ngle
,
const
QPointF
&
center
);
Shape2DSector
(
double
inner
R
adius
,
double
outer
R
adius
,
double
start
A
ngle
,
double
end
A
ngle
,
const
QPointF
&
center
);
Shape2DSector
(
const
Shape2DSector
&
sector
);
Shape2D
*
clone
()
const
override
{
return
new
Shape2DSector
(
*
this
);
}
bool
selectAt
(
const
QPointF
&
p
)
const
override
;
...
...
@@ -326,8 +331,8 @@ public:
QPointF
getPoint
(
const
QString
&
prop
)
const
override
;
void
setPoint
(
const
QString
&
prop
,
const
QPointF
&
value
)
override
;
/// Because setting the new bounding box makes no sense, this is just
overrode
/// and does nothing at all
/// Because setting the new bounding box makes no sense, this is just
///
overridden
and does nothing at all
virtual
void
setBoundingRect
(
const
RectF
&
rect
)
override
{
UNUSED_ARG
(
rect
);
}
/// Load state for the shape from a project file
...
...
@@ -341,8 +346,6 @@ protected:
void
addToPath
(
QPainterPath
&
/*path*/
)
const
override
{}
void
refit
()
override
;
void
resetBoundingRect
()
override
;
void
computeScaling
(
QPointF
BBoxCorner
,
QPointF
BBoxOpposedCorner
,
QPointF
bRectCorner
,
int
vertexIndex
);
size_t
getShapeNControlPoints
()
const
override
{
return
4
;
}
QPointF
getShapeControlPoint
(
size_t
i
)
const
override
;
void
setShapeControlPoint
(
size_t
i
,
const
QPointF
&
pos
)
override
;
...
...
@@ -351,10 +354,14 @@ protected:
double
m_startAngle
;
double
m_endAngle
;
QPointF
m_center
;
};
QRectF
findArcBoundingBox
(
double
startAngle
,
double
endAngle
);
double
distanceBetween
(
const
QPointF
&
,
const
QPointF
&
);
private:
void
computeScaling
(
const
QPointF
&
BBoxCorner
,
const
QPointF
&
BBoxOpposedCorner
,
const
QPointF
&
bRectCorner
,
int
vertexIndex
);
QRectF
findSectorBoundingBox
();
double
distanceBetween
(
const
QPointF
&
,
const
QPointF
&
)
const
;
};
/**
* An arbitrary shape. Implemented as a polygon.
...
...
qt/widgets/instrumentview/src/InstrumentWidgetMaskTab.cpp
View file @
25886188
...
...
@@ -652,6 +652,8 @@ void InstrumentWidgetMaskTab::doubleChanged(QtProperty *prop) {
m_instrWidget
->
getSurface
()
->
setCurrentPoint
(
name
,
p
);
}
}
// when the user validates the edit of the field, the view is immediatly
// updated this way
m_instrWidget
->
updateInstrumentView
();
}
m_instrWidget
->
update
();
...
...
qt/widgets/instrumentview/src/Shape2D.cpp
View file @
25886188
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment