2014-06-05 15:12:49 +00:00
|
|
|
#ifndef CANVASFRAGMENT_H
|
|
|
|
#define CANVASFRAGMENT_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
2014-06-10 13:13:16 +00:00
|
|
|
#include "Color.h"
|
|
|
|
#include "Vector3.h"
|
|
|
|
|
2014-06-05 15:12:49 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/**
|
2016-01-03 18:21:23 +00:00
|
|
|
* Representation of world coordinates projected in a canvas pixel.
|
2014-06-05 15:12:49 +00:00
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
class SOFTWARESHARED_EXPORT CanvasFragment {
|
|
|
|
public:
|
2015-09-10 20:06:50 +00:00
|
|
|
CanvasFragment() = default;
|
2015-11-09 21:30:46 +00:00
|
|
|
CanvasFragment(bool front_facing, const Vector3 &pixel, const Vector3 &location, int client = 0,
|
|
|
|
bool opaque = true);
|
2014-06-10 13:13:16 +00:00
|
|
|
|
2014-06-12 15:45:59 +00:00
|
|
|
void setColor(const Color &col);
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
inline bool getOpaque() const {
|
|
|
|
return opaque;
|
|
|
|
}
|
|
|
|
inline bool isFrontFacing() const {
|
|
|
|
return front_facing;
|
|
|
|
}
|
|
|
|
inline double getZ() const {
|
|
|
|
return pixel.z;
|
|
|
|
}
|
|
|
|
inline const Vector3 &getLocation() const {
|
|
|
|
return location;
|
|
|
|
}
|
|
|
|
inline const Vector3 &getPixel() const {
|
|
|
|
return pixel;
|
|
|
|
}
|
|
|
|
inline int getClient() const {
|
|
|
|
return client;
|
|
|
|
}
|
|
|
|
inline const Color &getColor() const {
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2014-06-10 13:13:16 +00:00
|
|
|
bool opaque;
|
2015-10-15 22:51:46 +00:00
|
|
|
bool front_facing;
|
|
|
|
Vector3 pixel;
|
2014-06-10 13:13:16 +00:00
|
|
|
Vector3 location;
|
|
|
|
int client;
|
|
|
|
Color color;
|
2014-06-05 15:12:49 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CANVASFRAGMENT_H
|