Commit ef1abca0 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Remove clang-format changes to MantidQt/* and MantidPlot/*

parent 483c041a
......@@ -56,13 +56,13 @@ namespace MantidQt
double &, double &,
double &) const override;
protected:
void rotate(const UnwrappedDetector &udet,
Mantid::Kernel::Quat &R) const override;
// void drawCustom(QPainter *painter) const;
protected:
void rotate(const UnwrappedDetector &udet,
Mantid::Kernel::Quat &R) const override;
//void drawCustom(QPainter *painter) const;
// Setup the projection axes
void setupAxes();
// Setup the projection axes
void setupAxes();
// Setup the projection axes
void setupBasisAxes(const Mantid::Kernel::V3D &zaxis, Mantid::Kernel::V3D &xaxis, Mantid::Kernel::V3D &yaxis) const;
// Find all flat banks of detectors.
......
......@@ -38,9 +38,9 @@ namespace MantidQt
}
void addToPath(QPainterPath &path) const override;
/* --- Own public methods --- */
/// Set new marker size to s
void setMarkerSize(const int &s);
/// Get marker size
/// Set new marker size to s
void setMarkerSize(const int& s);
/// Get marker size
int getMarkerSize()const { return m_markerSize; }
/// Get default marker size
static int getDefaultMarkerSize() { return g_defaultMarkerSize; }
......@@ -64,9 +64,9 @@ namespace MantidQt
/* --- Implemented Shape2D protected virtual methods --- */
void drawShape(QPainter &painter) const override;
void refit() override {}
/* --- Own protected methods --- */
void drawCircle(QPainter &painter) const;
void drawDiamond(QPainter& painter)const;
/* --- Own protected methods --- */
void drawCircle(QPainter& painter)const;
void drawDiamond(QPainter& painter)const;
void drawSquare(QPainter& painter)const;
private:
......
......@@ -127,8 +127,8 @@ namespace MantidQt
void clear() override;
/// Create the markers
void createMarkers(const PeakMarker2D::Style &style);
void addMarker(PeakMarker2D *m);
void createMarkers(const PeakMarker2D::Style &style);
void addMarker(PeakMarker2D *m);
QList<PeakMarker2D *> getMarkersWithID(int detID) const;
int getNumberPeaks() const;
Mantid::Geometry::IPeak &getPeak(int);
......@@ -153,10 +153,10 @@ namespace MantidQt
const std::string &wsName,
const Mantid::API::Workspace_sptr ws) override;
PeakMarker2D::Style getCurrentStyle() const;
void recreateMarkers(const PeakMarker2D::Style &style);
PeakMarker2D::Style getCurrentStyle() const;
void recreateMarkers(const PeakMarker2D::Style &style);
QMultiHash<int, PeakMarker2D *>
QMultiHash<int, PeakMarker2D *>
m_det2marker; ///< detector ID to PeakMarker2D map
mutable QList<PeakHKL> m_labels;
boost::shared_ptr<Mantid::API::IPeaksWorkspace>
......
......@@ -31,9 +31,9 @@ namespace MantidQt
~Projection3D() override;
RectF getSurfaceBounds() const override;
void setViewDirection(const QString &vd);
void set3DAxesState(bool on);
void setWireframe(bool on);
void setViewDirection(const QString& vd);
void set3DAxesState(bool on);
void setWireframe(bool on);
void componentSelected(
Mantid::Geometry::ComponentID = NULL) override;
......@@ -44,9 +44,9 @@ namespace MantidQt
QString getInfoText() const override;
signals:
void finishedMove();
void finishedMove();
protected slots:
protected slots:
void initTranslation(int x, int y);
void translate(int x, int y);
void initZoom(int x, int y);
......@@ -62,10 +62,10 @@ namespace MantidQt
bool picking = false) const override;
void changeColorMap() override;
void drawAxes(double axis_length = 100.0) const;
void setLightingModel(bool picking) const;
void drawAxes(double axis_length = 100.0)const;
void setLightingModel(bool picking)const;
bool m_drawAxes;
bool m_drawAxes;
bool m_wireframe;
Viewport m_viewport;
......
......@@ -77,10 +77,9 @@ namespace MantidQt
/// Destructor
~ProjectionSurface() override;
/// Resets the instrument actor.
void
resetInstrumentActor(const InstrumentActor *rootActor);
void resetInstrumentActor(const InstrumentActor* rootActor);
//-----------------------------------
//-----------------------------------
// Public virtual methods
//-----------------------------------
......
......@@ -62,12 +62,10 @@ namespace MantidQt
/// Destructor
~RectangularDetectorActor() override;
private:
void
AppendBoundingBox(const Mantid::Kernel::V3D &minBound,
const Mantid::Kernel::V3D &maxBound);
private:
void AppendBoundingBox(const Mantid::Kernel::V3D& minBound, const Mantid::Kernel::V3D& maxBound);
protected:
protected:
/// The rectangular detector
boost::shared_ptr<const Mantid::Geometry::RectangularDetector> mDet;
......@@ -83,11 +81,11 @@ namespace MantidQt
void
draw(bool picking = false) const override; ///< Method that
/// defines
/// ObjComponent
/// geometry. Calls
/// ObjComponent
/// draw method
///defines
///ObjComponent
///geometry. Calls
///ObjComponent
///draw method
void
getBoundingBox(Mantid::Kernel::V3D &minBound,
Mantid::Kernel::V3D &maxBound) const override;
......@@ -95,15 +93,13 @@ namespace MantidQt
VisitorAcceptRule rule = VisitAll) override;
bool accept(GLActorConstVisitor &visitor,
VisitorAcceptRule rule = VisitAll) const override;
bool isChildDetector(
const Mantid::Geometry::ComponentID &id) const;
void setColors() override;
bool isChildDetector(const Mantid::Geometry::ComponentID& id) const;
void setColors() override;
int genTexture(char *&image_data, std::vector<GLColor> &list,
bool useDetectorIDs);
void uploadTexture(char *&image_data) const;
int genTexture(char * & image_data, std::vector<GLColor>& list, bool useDetectorIDs);
void uploadTexture(char * & image_data)const;
private:
private:
/// Texture ID that holds the texture.
mutable unsigned int mTextureID;
......
......@@ -17,13 +17,9 @@ namespace MantidQt
public:
RotationSurface(const InstrumentActor* rootActor, const Mantid::Kernel::V3D& origin, const Mantid::Kernel::V3D& axis);
void init() override;
// Get the value of the u-correction - a shift in the
// u-coord added to automatically determined uv
// coordinates
QPointF getUCorrection() const {
return QPointF(m_u_min, m_u_max);
}
// Set new value for the u-correction
// Get the value of the u-correction - a shift in the u-coord added to automatically determined uv coordinates
QPointF getUCorrection() const { return QPointF(m_u_min, m_u_max); }
// Set new value for the u-correction
void setUCorrection(double umin, double umax);
// Set automatic u-correction
void setAutomaticUCorrection();
......
......@@ -61,12 +61,9 @@ namespace MantidQt
void getBoundingBox(
Mantid::Kernel::V3D &minBound,
Mantid::Kernel::V3D &maxBound) const override;
void setColor(const GLColor &c) { m_color = c; }
const ObjComponentActor *getSamplePosActor() const {
return m_samplePosActor;
}
protected:
void setColor(const GLColor& c) { m_color = c; }
const ObjComponentActor* getSamplePosActor()const { return m_samplePosActor; }
protected:
const InstrumentActor& m_instrActor;
const Mantid::API::Sample& m_sample;
const ObjComponentActor* m_samplePosActor;
......
......@@ -183,17 +183,17 @@ namespace MantidQt
void setPoint(const QString &prop,
const QPointF &value) override;
protected:
void drawShape(QPainter &painter) const override;
void refit() override {}
protected:
void drawShape(QPainter &painter) const override;
void refit() override {}
};
/**
* A axis aligned rectangle.
*
* No specific properties.
*/
class Shape2DRectangle : public Shape2D
/**
* A axis aligned rectangle.
*
* No specific properties.
*/
class Shape2DRectangle : public Shape2D
{
public:
Shape2DRectangle();
......@@ -208,22 +208,19 @@ namespace MantidQt
}
void addToPath(QPainterPath &path) const override;
protected:
void drawShape(QPainter &painter) const override;
void refit() override {}
protected:
void drawShape(QPainter &painter) const override;
void refit() override {}
};
/**
* A ring: area bounded by two curves of the same shape but
*different size.
*
* The constructor takes a curve shape and the ring widths in the
*x and y
* directions.
* It has QPointF "centre" property and "xwidth" and "ywidth"
*double properties.
*/
class Shape2DRing : public Shape2D
/**
* A ring: area bounded by two curves of the same shape but different size.
*
* The constructor takes a curve shape and the ring widths in the x and y
* directions.
* It has QPointF "centre" property and "xwidth" and "ywidth" double properties.
*/
class Shape2DRing : public Shape2D
{
public:
Shape2DRing(Shape2D* shape, double xWidth = 0.000001, double yWidth = 0.000001);
......@@ -250,20 +247,18 @@ namespace MantidQt
return m_outer_shape->getColor();
}
protected:
void drawShape(QPainter &painter) const override;
void addToPath(QPainterPath &) const override {}
void refit() override;
void resetBoundingRect() override;
size_t getShapeNControlPoints() const override {
return 4;
}
QPointF getShapeControlPoint(size_t i) const override;
void setShapeControlPoint(size_t i,
const QPointF &pos) override;
Shape2D *m_outer_shape;
Shape2D *m_inner_shape;
double m_xWidth;
protected:
void drawShape(QPainter &painter) const override;
void addToPath(QPainterPath &) const override {}
void refit() override;
void resetBoundingRect() override;
size_t getShapeNControlPoints() const override { return 4; }
QPointF getShapeControlPoint(size_t i) const override;
void setShapeControlPoint(size_t i,
const QPointF &pos) override;
Shape2D* m_outer_shape;
Shape2D* m_inner_shape;
double m_xWidth;
double m_yWidth;
};
......@@ -283,17 +278,16 @@ namespace MantidQt
bool selectAt(const QPointF &p) const override;
bool contains(const QPointF &p) const override;
void addToPath(QPainterPath &path) const override;
void addPolygon(const QPolygonF &polygon);
void subtractPolygon(const QPolygonF &polygon);
protected:
void addPolygon(const QPolygonF& polygon);
void subtractPolygon(const QPolygonF& polygon);
protected:
void drawShape(QPainter &painter) const override;
void refit() override;
void resetBoundingRect() override;
private:
RectF getPolygonBoundingRect() const;
QPolygonF m_polygon; ///< Implements the shape.
RectF getPolygonBoundingRect() const;
QPolygonF m_polygon; ///< Implements the shape.
QPainterPath m_outline; ///< Object to draw the shape's border.
};
}//MantidWidgets
......
......@@ -40,13 +40,11 @@ namespace MantidQt
Shape2DCollection();
~Shape2DCollection() override;
Shape2D *clone() const override { return NULL; }
void setWindow(const RectF &surface,
const QRect &viewport) const;
void setWindow(const RectF& surface, const QRect& viewport) const;
void draw(QPainter &painter) const override;
virtual void addShape(Shape2D *, bool slct = false);
virtual void removeShape(Shape2D *,
bool sendSignal = true);
virtual void removeShapes(const QList<Shape2D*>&);
virtual void addShape(Shape2D*, bool slct = false);
virtual void removeShape(Shape2D*, bool sendSignal = true);
virtual void removeShapes(const QList<Shape2D*>&);
virtual void clear();
void keyPressEvent(QKeyEvent*);
......@@ -113,9 +111,9 @@ namespace MantidQt
void refit() override;
void resetBoundingRect() override;
Shape2D *createShape(const QString &type, int x, int y) const;
bool selectControlPointAt(int x, int y);
void deselectControlPoint();
Shape2D* createShape(const QString& type, int x, int y)const;
bool selectControlPointAt(int x, int y);
void deselectControlPoint();
bool isOverCurrentAt(int x, int y);
bool isOverSelectionAt(int x, int y);
void addToSelection(Shape2D* shape);
......
......@@ -22,9 +22,8 @@ namespace MantidQt
explicit SimpleWidget(QWidget *parent);
~SimpleWidget() override;
/// Assign a surface to draw on
void setSurface(
boost::shared_ptr<ProjectionSurface> surface);
/// Return the surface
void setSurface(boost::shared_ptr<ProjectionSurface> surface);
/// Return the surface
boost::shared_ptr<ProjectionSurface> getSurface() { return m_surface; }
/// Redraw the view
void updateView(bool picking = true);
......@@ -42,9 +41,9 @@ namespace MantidQt
void keyPressEvent(QKeyEvent *) override;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
///< The projection surface
boost::shared_ptr<ProjectionSurface> m_surface;
};
///< The projection surface
boost::shared_ptr<ProjectionSurface> m_surface;
};
}//MantidWidgets
}//MantidQt
......
......@@ -20,9 +20,9 @@ namespace MantidQt
~UCorrectionDialog() override;
bool applyCorrection() const;
QPointF getValue() const;
QPointF getValue() const;
private:
private:
Ui::UCorrectionDialog *ui;
};
......
......@@ -25,7 +25,7 @@ namespace MantidQt
void rotate(const UnwrappedDetector &udet,
Mantid::Kernel::Quat &R) const override;
};
} // MantidWidgets
}//MantidWidgets
}//MantidQt
......
......@@ -26,7 +26,7 @@ namespace MantidQt
double &vscale) const override;
};
} // MantidWidgets
}//MantidWidgets
}//MantidQt
......
......@@ -95,35 +95,26 @@ namespace MantidQt
void getSelectedDetectors(QList<int> &dets) override;
void
getMaskedDetectors(QList<int> &dets) const override;
void setPeaksWorkspace(boost::shared_ptr<
Mantid::API::IPeaksWorkspace> pws);
void setPeaksWorkspace(boost::shared_ptr<Mantid::API::IPeaksWorkspace> pws);
QString getInfoText() const override;
RectF getSurfaceBounds() const override;
//@}
/** @name New public virtual methods */
//@{
/**
* Project a point in the 3D space onto the surface. The
*method returns the u- and v- coordinates of the
*projection
* as well as the scaling factors along the u and v axes.
*The scaling factors help to draw an approximate
*projection
* of a 3D object on the surface which is an orthographic
*projection of the object onto the tagent plane to the
* surface at point (uv) and scaled along u and v by the
*corresponding factor.
*
* @param pos :: A position of a 3D point.
* @param u (output) :: u-coordinate of the projection.
* @param v (output) :: v-coordinate of the projection.
* @param uscale (output) :: The scaling factor along the
*u-coordinate.
* @param vscale (output) :: The scaling factor along the
*v-coordinate.
*/
virtual void project(const Mantid::Kernel::V3D & pos, double & u, double & v, double & uscale, double & vscale) const = 0;
/** @name New public virtual methods */
//@{
/**
* Project a point in the 3D space onto the surface. The method returns the u- and v- coordinates of the projection
* as well as the scaling factors along the u and v axes. The scaling factors help to draw an approximate projection
* of a 3D object on the surface which is an orthographic projection of the object onto the tagent plane to the
* surface at point (uv) and scaled along u and v by the corresponding factor.
*
* @param pos :: A position of a 3D point.
* @param u (output) :: u-coordinate of the projection.
* @param v (output) :: v-coordinate of the projection.
* @param uscale (output) :: The scaling factor along the u-coordinate.
* @param vscale (output) :: The scaling factor along the v-coordinate.
*/
virtual void project(const Mantid::Kernel::V3D & pos, double & u, double & v, double & uscale, double & vscale) const = 0;
//@}
/** @name Public methods */
......@@ -152,20 +143,18 @@ namespace MantidQt
void drawSimpleToImage(QImage *image,
bool picking = false) const override;
void changeColorMap() override;
//@}
/** @name New protected virtual methods */
//@{
/**
* Calculate a rotation needed to see a detector from the
* correct angle on the surface.
* The rotation should be such that the detector is seen from
* the tip of the normal
* to the surface at the detector's position.
* @param udet :: A detector.
* @param R :: The result rotaion.
*/
virtual void rotate(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const = 0;
//@}
/** @name New protected virtual methods */
//@{
/**
* Calculate a rotation needed to see a detector from the correct angle on the surface.
* The rotation should be such that the detector is seen from the tip of the normal
* to the surface at the detector's position.
* @param udet :: A detector.
* @param R :: The result rotaion.
*/
virtual void rotate(const UnwrappedDetector& udet, Mantid::Kernel::Quat& R)const = 0;
virtual void calcUV(UnwrappedDetector& udet, Mantid::Kernel::V3D & pos);
virtual void calcSize(UnwrappedDetector& udet);
virtual QString getDimInfo() const;
......
......@@ -36,10 +36,9 @@ namespace MantidQt
void mouseMoveEvent(QMouseEvent *e) override;
void resizeEvent(QResizeEvent *e) override;
bool eventFilter(QObject *object, QEvent *e) override;
void updateMinMax();
private:
int m_resizeMargin; ///< distance from the left (or right) end of the slider within which it can be resized
void updateMinMax();
private:
int m_resizeMargin; ///< distance from the left (or right) end of the slider within which it can be resized
bool m_init;
bool m_resizingLeft; ///< the sider is in resizing mode
bool m_resizingRight; ///< the sider is in resizing mode
......
......@@ -192,17 +192,15 @@ namespace MantidQt
}
bool visit(const CompAssemblyActor *actor) override {
m_surface.addObjCompAssemblies(
actor->getComponent()->getComponentID());
return false;
}
m_surface.addObjCompAssemblies(actor->getComponent()->getComponentID());
return false;
}
bool
visit(const RectangularDetectorActor *actor) override {
m_surface.addRectangularDetector(
actor->getComponent()->getComponentID());
return false;
}
m_surface.addRectangularDetector(actor->getComponent()->getComponentID());
return false;
}
};
/**
......
......@@ -153,6 +153,7 @@ public:
const double occupancyFraction = 0.01; // 1%
physicalPeak.setOccupancyInView(occupancyFraction);// 1 %
auto drawingObject = physicalPeak.draw(1000, 1000);
TS_ASSERT_EQUALS(occupancyFraction, physicalPeak.getOccupancyInView());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment