예제 #1
0
ErrorDescriptor::ErrorDescriptor(const QString& prefix_text, const QString& postfix_text)
	:OperatorDescriptor("Error: " + prefix_text + postfix_text,
		QString(prefix_text).replace(" ", "SPACE") + " expr " + QString(postfix_text).replace(" ", "SPACE"),
		1, 0,
		prefix_text.isEmpty() ? OperatorDescriptor::LeftAssociative : OperatorDescriptor::RightAssociative),
		errorPrefix_(prefix_text), errorPostfix_(postfix_text)
{
	setTransient(true);
}
예제 #2
0
void AReViBalloon::hide()
{
//	shared_dynamic_cast<AReViWindow3D>(AReViMascaretApplication::getInstance()->accessWindow())->getAReViViewer()->accessFrontScene()->removeObject(thisRef());
//	shared_dynamic_cast<AReViWindow3D>(AReViMascaretApplication::getInstance()->accessWindow())->getAReViViewer()->accessFrontScene()->removeLight(_light);
    vector< shared_ptr<IEHA::Window3D> > windows = AReViMascaretApplication::getInstance()->getWindows();
    for(int i = 0; i < windows.size(); i++)
    {
        shared_dynamic_cast<AReViWindow3D>(windows[i])->getAReViViewer()->accessFrontScene()->removeObject(thisRef());
        shared_dynamic_cast<AReViWindow3D>(windows[i])->getAReViViewer()->accessFrontScene()->removeLight(_light);
    }
	setTransient(true);
}
예제 #3
0
AReViBalloon::AReViBalloon(ArCW &arCW, string text, double height, double width, double posX, double posY, double posZ, double /*oriZ*/)
	:	Object3D(arCW)
{
	setTransient(false);
	/* Instanciations */
	_mesh = Mesh3D::NEW();
	_shape = Shape3D::NEW();
	cerr << height << " "<<width << endl;
	_ctexture = CairoTexture::NEW(1024*height, 1024* width);
	_textManager=CairoTextManager::NEW(_ctexture);
	_textManager->setFontSize(200);

	/* Configuration */ 
	_ctexture->setLineWidth(12);
	_ctexture->setLineCap(CairoTexture::LINE_CAP_ROUND);

	double sx = height / 2;
	double sy = width / 2;

	/* Création mesh */
	_mesh->accessVertices().push_back(Util3D::Dbl3(-sx,-sy,0));
	_mesh->accessVertices().push_back(Util3D::Dbl3(+sx,-sy,0));
	_mesh->accessVertices().push_back(Util3D::Dbl3(+sx,+sy,0));
	_mesh->accessVertices().push_back(Util3D::Dbl3(-sx,+sy,0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(0.0,0.0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(1.0,0.0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(1.0,1.0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(0.0,1.0));
	_mesh->accessVertexFaces().push_back(Util3D::Face(0,1,3));
	_mesh->accessVertexFaces().push_back(Util3D::Face(1,2,3));
	_mesh->computeDefaultNormals(true);
	if (!_mesh->applyChanges(true)) 
		cerr << "ERREUR MESH ...." << endl;

	/* Orientation correcte mesh */
	ArRef<Transform3D> tr = calculateTransformation (1.57,1.57,0);

	_mesh->writeTransformation(tr);

	/* Lien entre objets */
	_shape->addRootPart(_mesh);
	_mesh->setTexture(_ctexture);
	_mesh->setTextureRepeat(false,false);
	
	/*----Dessin de la bulle et du texte----*/
	_text = text;

	/*-------Lien avec la shape--------*/
	setShape(_shape); 
	_shape->setBillboard(true,false);
	
	/*--------Placement de la bulle au-dessus du personnage----------*/
	translate(posX,posY,posZ);
	
	_light=Light3D::NEW();
	_light->setDirectional(false);
//	_light->setLocation(shared_dynamic_cast<AReViWindow3D>(AReViMascaretApplication::getInstance()->accessWindow())->getAReViViewer());
//	_light->attachTo(shared_dynamic_cast<AReViWindow3D>(AReViMascaretApplication::getInstance()->accessWindow())->getAReViViewer());
    vector< shared_ptr<IEHA::Window3D> > windows = AReViMascaretApplication::getInstance()->getWindows();
    for(int i = 0; i < windows.size(); i++)
    {
        _light->setLocation(shared_dynamic_cast<AReViWindow3D>(windows[i])->getAReViViewer());
        _light->attachTo(shared_dynamic_cast<AReViWindow3D>(windows[i])->getAReViViewer());
    }

	/*--------Affichage de la bulle------*/
	show();

}