BEGIN_JLIB_GRAPHICS_VIEWPORT_MANIPULATORS_NAMESPACE


translate::translate( )
    {
    addTool( tool );
    }
Ejemplo n.º 2
0
void LocalContrastPlugin::setup(QObject* const parent)
{
    LocalContrast* const tool = new LocalContrast(parent);
    tool->setPlugin(this);

    addTool(tool);
}
Ejemplo n.º 3
0
bool taskLayer::init() {

	if (!Layer::init())
	{
		return false;
	}
	audioFlag = DataXML::getInstence()->getInitialValue("sound");
	allCondition["multi2long"] =0;
	allCondition["useablebloodbutton"] = 0;
	allCondition["plus50"] = 0;
	allCondition["multi2short"] = 0;
	allCondition["blood_drop"] = 0;
	allCondition["beartrap"] = 0;
	allCondition["campfire"] = 0;
	allCondition["plaster"] = 0;
	allCondition["blade_low"] = 0;
	allCondition["e_fence"] = 0;
	count = 0;

	addSprite();
 	showTask();
 	addTool();
	

	NotificationCenter::getInstance()->addObserver(this,callfuncO_selector(taskLayer::testMessage),"task",NULL);
	return true;
}
Ejemplo n.º 4
0
void AssignTemplatePlugin::setup(QObject* const parent)
{
    AssignTemplate* const tool = new AssignTemplate(parent);
    tool->setPlugin(this);

    addTool(tool);
}
Ejemplo n.º 5
0
void HSLCorrectionPlugin::setup(QObject* const parent)
{
    HSLCorrection* const tool = new HSLCorrection(parent);
    tool->setPlugin(this);

    addTool(tool);
}
Ejemplo n.º 6
0
void CropPlugin::setup(QObject* const parent)
{
    Crop* const tool = new Crop(parent);
    tool->setPlugin(this);

    addTool(tool);
}
Ejemplo n.º 7
0
void ColorFXPlugin::setup(QObject* const parent)
{
    ColorFX* const tool = new ColorFX(parent);
    tool->setPlugin(this);

    addTool(tool);
}
Ejemplo n.º 8
0
void init(){
	uart0Init();
    sei();
    uart0PutString("gerald test\n\r");
	consoleInit();
	addTool(&stepMotorTool, "stm", NULL);
	sMenabel();
}
Ejemplo n.º 9
0
MarkSizeBar::MarkSizeBar(Mode *mode, QGraphicsItem *parent):
  Toolbar(parent), mode(mode) {
  for (int i=0; i<nMarkSizes; i++) 
    addTool(sizeToId(markSizes[i]), new MarkSizeItem(markSizes[i]));

  mode->setMarkSize(markSizes[2]);
  select(sizeToId(mode->markSize()));
  setShape(mode->shape());
}
Ejemplo n.º 10
0
//修改lebal显示
void taskLayer::changeDisplay(std::string name) {

	int i = 0;
	ValueMap taskMap = DataXML::getInstence()->getTask();

		Label *  rects = dynamic_cast<Label *> (this->getChildByName(name)->getChildByName(name));
		for (auto v : taskMap)
		{
			std::string taskName = v.first;
			if (taskName == name)
			{
				
				rects->setString(StringUtils::format("%d/%d",allCondition.at(v.first).asInt(),v.second.asInt()));
				if (allCondition.at(v.first) == v.second)
				{
					
					count++;
					Sprite * fangKuang  = dynamic_cast<Sprite *> (this->getChildByName(name));
					EFFECT_MUSIC("unlocked_row.mp3", audioFlag);
					fangKuang->setTexture(CONDITION_YES_FILENAME);
				}

				if (count == 3)
				{
					count = 0;
					for (auto v : allCondition)
					{
						allCondition.at(v.first) = 0;
					}
					//完成任务,写入XML,更改isfinish,任务完成后计数清零!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
					//解锁道具,写入XML,更改isOpen
					for (int i = 0; i < taskSprites.size(); i++)
					{
						taskSprites.at(i)->removeFromParentAndCleanup(true);
					}

					taskSprites.clear();

					DataXML::getInstence()->finishTask();
					//更换任务,添加任务全部完成的情况,别忘了!!!!!!!!!!!!!!!!!!还有道具!!!!!!!!!!!!!!!
					showTask();
					setLabel();
					//移除并更换新道具
					taskTool->removeFromParentAndCleanup(true);
					//播放音效
					EFFECT_MUSIC("unlocked_rooster.mp3", audioFlag);
					addTool();
				} 
			}
		}
		i++;
}
Ejemplo n.º 11
0
void SelectionPlugin::onPluginEnable()
{
	wxAuiToolBar* toolbar = editor->getToolbar();

	if(toolbar)
	{
		addTool( toolbar->AddSeparator() );

		wxBitmap iconSelect = wxMEMORY_BITMAP(cursor);
		buttonSelect = toolbar->AddTool( SelectionTool::Select, "Select",
			iconSelect, "Selects the selection tool", wxITEM_RADIO );
		addTool(buttonSelect, true);

		#pragma TODO(Remove the hack to select the select tool automatically)
		((ToolbarHack*) toolbar)->SelectItem(buttonSelect);
	}

	selections = nullptr;
	buttonSelect = nullptr;
	additiveMode = false;
	handlingEvents = false;
}
bool ConfigToolboxDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: addTool(); break;
    case 1: removeTool(); break;
    case 2: moveToolUp(); break;
    case 3: moveToolDown(); break;
    case 4: currentToolChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 5: currentCommonToolChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: ok(); break;
    case 7: languageChange(); break;
    default:
	return QDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
Ejemplo n.º 13
0
int main(){
	//char *ptr =(char*)getDataPtr(0);
	uart0Init();
	sei();
	uart0PutString("MPU\n\r");
	
	uart0SetStdout();	
	
	consoleInit();	
	i2c_init();

	addTool(&mpu6050Tool, "mpu");

	while(1){
		consoleUpdate();	
	}
	return 0;
}
Ejemplo n.º 14
0
void PrefsDialog::init()
{
	setupUi(this);
	
	connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
	
	connect(binPathList, SIGNAL(itemSelectionChanged()), this, SLOT(updatePathButtons()));
	connect(pathUp, SIGNAL(clicked()), this, SLOT(movePathUp()));
	connect(pathDown, SIGNAL(clicked()), this, SLOT(movePathDown()));
	connect(pathAdd, SIGNAL(clicked()), this, SLOT(addPath()));
	connect(pathRemove, SIGNAL(clicked()), this, SLOT(removePath()));

	connect(toolList, SIGNAL(itemSelectionChanged()), this, SLOT(updateToolButtons()));
	connect(toolList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editTool(QListWidgetItem*)));
	connect(toolUp, SIGNAL(clicked()), this, SLOT(moveToolUp()));
	connect(toolDown, SIGNAL(clicked()), this, SLOT(moveToolDown()));
	connect(toolAdd, SIGNAL(clicked()), this, SLOT(addTool()));
	connect(toolRemove, SIGNAL(clicked()), this, SLOT(removeTool()));
	connect(toolEdit, SIGNAL(clicked()), this, SLOT(editTool()));
	
	connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(changedTabPanel(int)));
	
	pathsChanged = toolsChanged = false;
}
Ejemplo n.º 15
0
void GLWidget::setTools(const QList<QtGui::ToolPlugin *> &toolList)
{
  foreach (QtGui::ToolPlugin *tool, toolList)
    addTool(tool);
}
Ejemplo n.º 16
0
void GenGame::genGame(DBManager* myDB){
	// Se prepara el directorio de salida
	outputPath = ".\\";//..\\..\\interprete\\bin\\";

	string command = "mkdir ";
	// Creamos el dir ppal
	command.append(outputPath);
	if (system(NULL)) system(command.c_str());
	// Dir de datos
	command = "mkdir " + outputPath + DATA_PATH;
	if (system(NULL)) system(command.c_str());
	// Dir de mapas
	command.append(MAPS_PATH);
	if (system(NULL)) system(command.c_str());
	// Dir de recursos
	command = "mkdir " + outputPath + DATA_PATH;
	command.append(RES_PATH);
	if (system(NULL)) system(command.c_str());

	/* ---- Decidator obtiene los datos para los generadores ---- */
	// la GUI guardará el archivo que posteriormente leerá decidator para obtener la información
	decidator = new Decidator(myDB, "./input.dat");
	int wSize = decidator->getWorldSize();
	int numDungeons = decidator->getNumDungeons();
	int diff = decidator->getDifficulty();
	int numZones = min(2 * diff, 4) + rand() % 2;
	decidator->setNumKeyObj(numZones);
	int ratioDungeon = decidator->getRatio();
	int numSafeZones = decidator->getNumSafeZones();
	//LO QUITO PORQUE 5 ES BASTANTE BASTANTE!
	int numEnemies = 3; //decidator->getNumEnemies();
	int numPigeons = decidator->getNumPigeons();
	int numBigHearts = decidator->getNumBigHearts();

	/* Pedimos cosas a la DB */
	myDB->getPlayer();
	myDB->getKey();
	myDB->getBossKey();
	myDB->getDoors();
	short keyObj = myDB->getKeyObj();
	//pillamos 25 items para que pueda tenerlos el juego XD!
	myDB->getPowUp();
	for (int i = 0; i < 25; i++)
		myDB->getItem();

	// Debug code sexy sexy
	decidator->clearInitialTools();
	for (int i = 0; i < decidator->getNumTools(); i++)
	{
		int tries = 100;
		bool ok = false;
		while (!ok && tries > 0)
		{
			int idTool = myDB->getTool();
			if (!toolSelected(idTool))
			{
				decidator->addInitialTool(idTool);
				addTool(idTool);
				ok = true;
			}
			tries--;
		}
	}

	zones = new vector<GenZone*>();

	//int numHearts = decidator->getInitialMaxLife();
	ow = new Overworld(wSize, diff, numZones, numDungeons, numSafeZones, numBigHearts, numPigeons);
	GenDungeon* genDungeon = new GenDungeon();
	Decorator* decorator = new WorldDecorator(myDB);
	int numDungeon = 1; 
	int idTool = 1;   //params para la dungeon
	vector<SafeZoneInfo>* safeZones = NULL;//new vector<SafeZoneInfo>();
	ZoneInfo zInfo;
	int zoneNumber = 1;
	string lastzone = "";
	while((int)zones->size() < numZones)
	{
		while(strcmp(zInfo.gen.c_str(),lastzone.c_str()) == 0)
			zInfo = myDB->getZone();

		int idTool;
		bool ok = false;
		int tries = 100;
		while (!ok && tries > 0)
		{
			idTool = myDB->getTool();
			if (!toolSelected(idTool))
			{
				addTool(idTool);
				ok = true;
			}
			tries--;
		}

		if(strcmp(zInfo.gen.c_str(), "Forest") == 0)
		{ 
				GenZone* myGenZone = new GenForestZone(zInfo.gen, zoneNumber, zInfo.tileSetId, ow, numEnemies, /*dificultad*/diff, genDungeon, numDungeon, idTool, ratioDungeon, safeZones, decorator, myDB, keyObj);
				zoneNumber++;
				zones->push_back(myGenZone);
		}
		else if(strcmp(zInfo.gen.c_str(), "Prairie") == 0)
		{
				GenZone* myGenZone = new GenFieldZone(zInfo.gen, zoneNumber, zInfo.tileSetId, ow, numEnemies,diff,  genDungeon, numDungeon, idTool, ratioDungeon, safeZones, decorator, myDB, keyObj);
				zoneNumber++;
				zones->push_back(myGenZone);
		}
		else if(strcmp(zInfo.gen.c_str(), "Lake") == 0)
		{
				//GenZone* myGenZone = new GenWormZone("theme-default", zoneTheme, zoneNumber, NULL, ow, numEnemies, genDungeon, /*numDungeon*/zoneNumber, idTool, ratioDungeon, safeZones, decorator, myDB);
				GenZone* myGenZone = new GenLagoonZone(zInfo.gen, zoneNumber, zInfo.tileSetId, ow, numEnemies, diff, genDungeon, numDungeon, idTool, ratioDungeon, safeZones, decorator, myDB, keyObj);
				zoneNumber++;
				zones->push_back(myGenZone);
		}
		else if(strcmp(zInfo.gen.c_str(), "Desert") == 0)
		{
				//GenZone* myGenZone = new GenWormZone("theme-default", zoneTheme, zoneNumber, NULL, ow, numEnemies, genDungeon, /*numDungeon*/zoneNumber, idTool, ratioDungeon, safeZones, decorator, myDB);
				GenZone* myGenZone = new GenDesertZone(zInfo.gen, zoneNumber, zInfo.tileSetId, ow, numEnemies, diff, genDungeon, numDungeon, idTool, ratioDungeon, safeZones, decorator, myDB, keyObj);
				zoneNumber++;
				zones->push_back(myGenZone);
		}
		lastzone = zInfo.gen;
		numDungeon++;
	}
	
	// Decidator obtiene de la base de dator el generador de mundo a utilizar
	/*switch (decidator->getWorldGen()){   Lo comento de momento porque la consulta no devuelve na y estalla esto x.x
	case 1:
		genOw = new GenVoroWorld(ow, zones, myDB);	
		break;
	}*/
	genOw = new GenVoroWorld(ow, zones,genDungeon, decorator, myDB);	

	world = new World(diff, genOw, myDB);

	world->buildOverworld();
	ow->save(outputPath); //ahora aquí se hace el guardado
	for (int i = 0; i < genDungeon->getNumDungeons(); i++) //guardamos todas las dungeons
		genDungeon->getDungeon(i)->save(outputPath);

	// mazmorra final no se cuenta
	numDungeon++;

	decidator->setNumMaps(numDungeon);
	// Decidator guarda la información que necesita el intérprete (como número de piezas de corazón, etc...)
	decidator->save();

	// De momento copia prologo y textos aunque lo harán los decidator historiator y demás
	outputPath = ".\\data\\";
	command = "copy " + outputPath + "prologue.txt " + DATA_PATH;
	if (system(NULL)) system(command.c_str()); 
	command = "copy " + outputPath + "textos.txt " + DATA_PATH;
	if (system(NULL)) system(command.c_str());
	// Copia configs
	command = "copy " + outputPath + "config-p1 " + DATA_PATH;
	if (system(NULL)) system(command.c_str());
	command = "copy " + outputPath + "config-p1-template " + DATA_PATH;
	if (system(NULL)) system(command.c_str());
	command = "copy " + outputPath + "config-p1-joy " + DATA_PATH;
	if (system(NULL)) system(command.c_str());
	// Copia maininfo 
	command = "copy " + outputPath + "maininfo "+ DATA_PATH;
	if (system(NULL)) system(command.c_str());

	delete genDungeon; 
	genDungeon = NULL;

	delete decorator;
	decorator = NULL;
}
Ejemplo n.º 17
0
/*
 *  Constructs a ConfigToolboxDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
ConfigToolboxDialog::ConfigToolboxDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ConfigToolboxDialog" );
    ConfigToolboxDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "ConfigToolboxDialogLayout"); 

    Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); 
    Spacer2 = new QSpacerItem( 342, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout2->addItem( Spacer2 );

    PushButton3 = new QPushButton( this, "PushButton3" );
    PushButton3->setDefault( TRUE );
    Layout2->addWidget( PushButton3 );

    PushButton4 = new QPushButton( this, "PushButton4" );
    Layout2->addWidget( PushButton4 );

    ConfigToolboxDialogLayout->addMultiCellLayout( Layout2, 1, 1, 0, 1 );

    Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4"); 

    buttonAdd = new QPushButton( this, "buttonAdd" );
    buttonAdd->setEnabled( FALSE );

    Layout4->addWidget( buttonAdd, 1, 1 );
    Spacer3 = new QSpacerItem( 111, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout4->addItem( Spacer3, 1, 0 );

    listViewTools = new QListView( this, "listViewTools" );
    listViewTools->addColumn( tr( "Available Tools" ) );
    listViewTools->setSelectionMode( QListView::Extended );
    listViewTools->setResizeMode( QListView::LastColumn );

    Layout4->addMultiCellWidget( listViewTools, 0, 0, 0, 1 );

    ConfigToolboxDialogLayout->addLayout( Layout4, 0, 0 );

    Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5"); 

    buttonRemove = new QPushButton( this, "buttonRemove" );
    buttonRemove->setEnabled( FALSE );

    Layout5->addWidget( buttonRemove, 1, 0 );

    listViewCommon = new QListView( this, "listViewCommon" );
    listViewCommon->addColumn( tr( "Common Widgets Page" ) );
    listViewCommon->setSelectionMode( QListView::Extended );
    listViewCommon->setResizeMode( QListView::LastColumn );

    Layout5->addMultiCellWidget( listViewCommon, 0, 0, 0, 3 );

    buttonDown = new QToolButton( this, "buttonDown" );
    buttonDown->setEnabled( FALSE );
    buttonDown->setPixmap( QPixmap::fromMimeSource( "designer_s_down.png" ) );

    Layout5->addWidget( buttonDown, 1, 3 );
    Spacer4 = new QSpacerItem( 41, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout5->addItem( Spacer4, 1, 1 );

    buttonUp = new QToolButton( this, "buttonUp" );
    buttonUp->setEnabled( FALSE );
    buttonUp->setPixmap( QPixmap::fromMimeSource( "designer_s_up.png" ) );

    Layout5->addWidget( buttonUp, 1, 2 );

    ConfigToolboxDialogLayout->addLayout( Layout5, 0, 1 );
    languageChange();
    resize( QSize(403, 467).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addTool() ) );
    connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( removeTool() ) );
    connect( buttonUp, SIGNAL( clicked() ), this, SLOT( moveToolUp() ) );
    connect( buttonDown, SIGNAL( clicked() ), this, SLOT( moveToolDown() ) );
    connect( listViewTools, SIGNAL( clicked(QListViewItem*) ), this, SLOT( currentToolChanged(QListViewItem*) ) );
    connect( listViewCommon, SIGNAL( clicked(QListViewItem*) ), this, SLOT( currentCommonToolChanged(QListViewItem*) ) );
    connect( PushButton3, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( PushButton4, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( PushButton3, SIGNAL( clicked() ), this, SLOT( ok() ) );
    connect( listViewTools, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( addTool() ) );
    init();
}
Ejemplo n.º 18
0
NoteInfo::NoteInfo(QWidget* parent)
: QWidget(parent)
{
	deltaMode = false;

	m_layout = new QVBoxLayout(this);

	selTime = new PosEdit;
	selTime->setObjectName("Start");
	addTool(tr("Start"), selTime);

	selLen = new QSpinBox();
	selLen->setRange(0, 100000);
	selLen->setSingleStep(1);
	addTool(tr("Len"), selLen);

	selPitch = new PitchEdit;
	addTool(tr("Pitch"), selPitch);

	selVelOn = new QSpinBox();
	selVelOn->setRange(0, 127);
	selVelOn->setSingleStep(1);
	addTool(tr("Velo On"), selVelOn);

	selVelOff = new QSpinBox();
	selVelOff->setRange(0, 127);
	selVelOff->setSingleStep(1);
	addTool(tr("Velo Off"), selVelOff);

	m_renderAlpha = new QSpinBox();
	m_renderAlpha->setRange(0, 255);
	m_renderAlpha->setSingleStep(1);
	int alpha = tconfig().get_property("PianorollEdit", "renderalpha", 50).toInt();
	m_renderAlpha->setValue(alpha);

	addTool(tr("BG Brightness"), m_renderAlpha);

	m_partLines = new QCheckBox(this);
	bool pl = tconfig().get_property("PianorollEdit", "partLines", true).toBool();
	m_partLines->setChecked(pl);
	addTool(tr("Part End Marker"), m_partLines);

	//start tb1 merge/*{{{*/
	//---------------------------------------------------
	//  Raster, Quant.
	//---------------------------------------------------

    rasterLabel = new GridCombo(this);
    quantLabel = new GridCombo(this);

	rlist = new QTableWidget(10, 3);
	rlist->setObjectName("listSnap");
	qlist = new QTableWidget(8, 3);
	qlist->setObjectName("listQuant");
	rlist->verticalHeader()->setDefaultSectionSize(22);
	rlist->horizontalHeader()->setDefaultSectionSize(32);
	rlist->setSelectionMode(QAbstractItemView::SingleSelection);
	rlist->verticalHeader()->hide();
	rlist->horizontalHeader()->hide();
	qlist->verticalHeader()->setDefaultSectionSize(22);
	qlist->horizontalHeader()->setDefaultSectionSize(32);
	qlist->setSelectionMode(QAbstractItemView::SingleSelection);
	qlist->verticalHeader()->hide();
	qlist->horizontalHeader()->hide();

	rlist->setMinimumWidth(96);
	qlist->setMinimumWidth(96);

	rasterLabel->setView(rlist);
	quantLabel->setView(qlist);

	for (int j = 0; j < 3; j++)
		for (int i = 0; i < 10; i++)
			rlist->setItem(i, j, new QTableWidgetItem(tr(rasterStrings[i + j * 10])));
	for (int j = 0; j < 3; j++)
		for (int i = 0; i < 8; i++)
			qlist->setItem(i, j, new QTableWidgetItem(tr(quantStrings[i + j * 8])));

	setRaster(96);
	setQuant(96);

    rasterLabel->setMinimumSize(QSize(80, 22));
    quantLabel->setMinimumSize(QSize(80, 22));

	QHBoxLayout *hbox1 = new QHBoxLayout();
	hbox1->addWidget(new QLabel(tr("Snap")));
	hbox1->addWidget(rasterLabel);
	QHBoxLayout *hbox2 = new QHBoxLayout();
	hbox2->addWidget(new QLabel(tr("Quant.")));
	hbox2->addWidget(quantLabel);
	m_layout->addLayout(hbox1);
	m_layout->addLayout(hbox2);

	//---------------------------------------------------
	//  To Menu
	//---------------------------------------------------
	QComboBox* toList = new QComboBox;
	toList->insertItem(0, tr("All Events"));
	toList->insertItem(CMD_RANGE_LOOP, tr("Looped Ev."));
	toList->insertItem(CMD_RANGE_SELECTED, tr("Selected Ev."));
	toList->insertItem(CMD_RANGE_LOOP | CMD_RANGE_SELECTED, tr("Looped+Sel."));
    toList->setMinimumSize(QSize(80, 22));
	QHBoxLayout *hbox3 = new QHBoxLayout();
	hbox3->addWidget(new QLabel(tr("To")));
	hbox3->addWidget(toList);
	m_layout->addLayout(hbox3);

    connect(rasterLabel, SIGNAL(activated(int)), SLOT(_rasterChanged(int)));
    connect(quantLabel, SIGNAL(activated(int)), SLOT(_quantChanged(int)));
    connect(toList, SIGNAL(activated(int)), SIGNAL(toChanged(int)));
	//end tb1/*}}}*/
	QSpacerItem* vSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
	m_layout->addItem(vSpacer);

	connect(selLen, SIGNAL(valueChanged(int)), SLOT(lenChanged(int)));
	connect(selPitch, SIGNAL(valueChanged(int)), SLOT(pitchChanged(int)));
	connect(selVelOn, SIGNAL(valueChanged(int)), SLOT(velOnChanged(int)));
	connect(selVelOff, SIGNAL(valueChanged(int)), SLOT(velOffChanged(int)));
	connect(m_renderAlpha, SIGNAL(valueChanged(int)), SLOT(alphaChanged(int)));
	connect(selTime, SIGNAL(valueChanged(const Pos&)), SLOT(timeChanged(const Pos&)));
	connect(m_partLines, SIGNAL(toggled(bool)), SLOT(partLinesChanged(bool)));
}
Ejemplo n.º 19
0
MetavoxelEditor::MetavoxelEditor() :
    QWidget(Application::getInstance()->getGLWidget(), Qt::Tool | Qt::WindowStaysOnTopHint) {
    
    setWindowTitle("Metavoxel Editor");
    setAttribute(Qt::WA_DeleteOnClose);

    QVBoxLayout* topLayout = new QVBoxLayout();
    setLayout(topLayout);
    
    QGroupBox* attributeGroup = new QGroupBox();
    attributeGroup->setTitle("Attributes");
    topLayout->addWidget(attributeGroup);
    
    QVBoxLayout* attributeLayout = new QVBoxLayout();
    attributeGroup->setLayout(attributeLayout);
    
    attributeLayout->addWidget(_attributes = new QListWidget());
    connect(_attributes, SIGNAL(itemSelectionChanged()), SLOT(selectedAttributeChanged()));

    QHBoxLayout* attributeButtonLayout = new QHBoxLayout();
    attributeLayout->addLayout(attributeButtonLayout);

    QPushButton* newAttribute = new QPushButton("New...");
    attributeButtonLayout->addWidget(newAttribute);
    connect(newAttribute, SIGNAL(clicked()), SLOT(createNewAttribute()));

    attributeButtonLayout->addWidget(_deleteAttribute = new QPushButton("Delete"));
    _deleteAttribute->setEnabled(false);
    connect(_deleteAttribute, SIGNAL(clicked()), SLOT(deleteSelectedAttribute()));

    QFormLayout* formLayout = new QFormLayout();
    topLayout->addLayout(formLayout);
    
    formLayout->addRow("Grid Plane:", _gridPlane = new QComboBox());
    _gridPlane->addItem("X/Y");
    _gridPlane->addItem("X/Z");
    _gridPlane->addItem("Y/Z");
    _gridPlane->setCurrentIndex(GRID_PLANE_XZ);
    connect(_gridPlane, SIGNAL(currentIndexChanged(int)), SLOT(centerGridPosition()));
    
    formLayout->addRow("Grid Spacing:", _gridSpacing = new QDoubleSpinBox());
    _gridSpacing->setMinimum(-FLT_MAX);
    _gridSpacing->setMaximum(FLT_MAX);
    _gridSpacing->setPrefix("2^");
    _gridSpacing->setValue(-3.0);
    connect(_gridSpacing, SIGNAL(valueChanged(double)), SLOT(alignGridPosition()));

    formLayout->addRow("Grid Position:", _gridPosition = new QDoubleSpinBox());
    _gridPosition->setMinimum(-FLT_MAX);
    _gridPosition->setMaximum(FLT_MAX);
    alignGridPosition();
    centerGridPosition();
    
    formLayout->addRow("Tool:", _toolBox = new QComboBox());
    connect(_toolBox, SIGNAL(currentIndexChanged(int)), SLOT(updateTool()));
    
    _value = new QGroupBox();
    _value->setTitle("Value");
    topLayout->addWidget(_value);
    
    QVBoxLayout* valueLayout = new QVBoxLayout();
    _value->setLayout(valueLayout);

    valueLayout->addWidget(_valueArea = new QScrollArea());
    _valueArea->setMinimumHeight(200);
    _valueArea->setWidgetResizable(true);

    addTool(new BoxSetTool(this));
    addTool(new GlobalSetTool(this));
    addTool(new InsertSpannerTool(this));
    addTool(new RemoveSpannerTool(this));
    addTool(new ClearSpannersTool(this));
    addTool(new SetSpannerTool(this));
    
    updateAttributes();
    
    connect(Application::getInstance(), SIGNAL(simulating(float)), SLOT(simulate(float)));
    connect(Application::getInstance(), SIGNAL(renderingInWorldInterface()), SLOT(render()));
    
    Application::getInstance()->getGLWidget()->installEventFilter(this);
    
    show();
    
    if (_gridProgram.isLinked()) {
        return;
    }
        
    _gridProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() + "shaders/grid.frag");
    _gridProgram.link();
}
Ejemplo n.º 20
0
void toolInit(){
	addTool(&help, "help", NULL);
	addTool(&test, "test", NULL);
	addTool(&led, "led", NULL);

}