MeVisLab Toolbox Reference
View2DIcons.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
16
17#pragma once
18
19#include "View2DTexture.h"
20#include <vector>
21
24{
25public:
29
31 void drawIcon(int idx, float dx1, float dy1, float dx2, float dy2);
32
38 void drawIconAsBorderImage(int idx, float dx1, float dy1, float dx2, float dy2, float borderWidth, float borderHeight);
39
41 bool addIcon(const char* filename);
43 bool addIcons(const char* filename, int width, int height);
44
47
49 int numIcons();
50
52 void removeIcon(int index);
53
55 void clearIcons();
56
57private:
58 std::vector<View2DTexture*> _icons;
59};
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
Defines and implements a class to store multiple images and draw them via OpenGL.
Definition View2DIcons.h:24
bool addIcons(const char *filename, int width, int height)
add icons from file by splitting the file into width x height blocks
void drawIcon(int idx, float dx1, float dy1, float dx2, float dy2)
draw the icon at index i
void drawIconAsBorderImage(int idx, float dx1, float dy1, float dx2, float dy2, float borderWidth, float borderHeight)
draws the given icon from dx1,dy1 to dx2,dy2 using 3x3 quads (the corners/border regions defined by b...
void removeIcon(int index)
remove an icon
void clearIcons()
clear all icons
int numIcons()
get number of icons
bool addIcon(const char *filename)
add icon from file
View2DTexture * getIcon(int index)
get icon at index
View2DIcons()
Constructor and destructor.
A class to render images as OpenGL Textures.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.