You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.1 KiB
61 lines
1.1 KiB
#include "BaseSource.h"
|
|
|
|
namespace ofx {
|
|
namespace piMapper {
|
|
|
|
BaseSource::BaseSource(){
|
|
//cout << "BaseSource" << endl;
|
|
init();
|
|
}
|
|
|
|
BaseSource::BaseSource(ofTexture * newTexture){
|
|
init();
|
|
texture = newTexture;
|
|
}
|
|
|
|
BaseSource::~BaseSource(){}
|
|
|
|
ofTexture * BaseSource::getTexture(){
|
|
return texture;
|
|
}
|
|
|
|
string & BaseSource::getName(){
|
|
return name;
|
|
}
|
|
|
|
bool BaseSource::isLoadable(){
|
|
return loadable;
|
|
}
|
|
|
|
bool BaseSource::isLoaded(){
|
|
return loaded;
|
|
}
|
|
|
|
SourceType BaseSource::getType(){
|
|
return type;
|
|
}
|
|
|
|
string & BaseSource::getPath(){
|
|
return path;
|
|
}
|
|
|
|
void BaseSource::init(){
|
|
texture = 0;
|
|
name = "";
|
|
path = "";
|
|
loadable = false;
|
|
loaded = false;
|
|
type = SourceType::SOURCE_TYPE_NONE;
|
|
referenceCount = 1; // We have one instance on init
|
|
}
|
|
|
|
void BaseSource::setNameFromPath(string & fullPath){
|
|
vector <string> pathParts;
|
|
//cout << "fullPath: " << fullPath << endl;
|
|
pathParts = ofSplitString(fullPath, "/"); // Maybe on win "/" is "\", have to test
|
|
//cout << "lastPathPart: " << pathParts[pathParts.size() - 1] << endl;
|
|
name = pathParts[pathParts.size() - 1];
|
|
}
|
|
|
|
} // namespace piMapper
|
|
} // namespace ofx
|