Base::Base(){ nombre_obj = "Base"; Tupla3f a(-1,0,1), b(-1,0,-1), c(1,0,-1), d(1,0,1), e(-1,0.5,1), f(-1,0.5,-1), g(1,0.5,-1), h(1,0.5,1); vertices.push_back(a); vertices.push_back(b); vertices.push_back(c); vertices.push_back(d); vertices.push_back(e); vertices.push_back(f); vertices.push_back(g); vertices.push_back(h); Tupla3i i1(0,7,4), i2(0,3,7), i3(3,6,7), i4(3,2,6), i5(2,5,6), i6(2,1,5), i7(1,4,5), i8(1,0,4), i9(4,6,7), i10(4,6,5), i11(0,2,1),i12(0,3,2); caras.push_back(i1); caras.push_back(i2); caras.push_back(i3); caras.push_back(i4); caras.push_back(i5); caras.push_back(i6); caras.push_back(i7); caras.push_back(i8); caras.push_back(i9); caras.push_back(i10); caras.push_back(i11); caras.push_back(i12); }
static void TestInteger32() { // constructors SnmpInt32 i1; ACE_ASSERT(i1 == def); SnmpInt32 i2(l); ACE_ASSERT(i2 == l); SnmpInt32 i3(nl); ACE_ASSERT(i3 == nl); SnmpInt32 i4(ul); ACE_ASSERT(i4 == ul); SnmpInt32 i5(i); ACE_ASSERT(i5 == i); SnmpInt32 i6(ni); ACE_ASSERT(i6 == ni); SnmpInt32 i7(ui); ACE_ASSERT(i7 == ui); SnmpInt32 *i8 = new SnmpInt32(i5); ACE_ASSERT(i8 != 0); delete i8; ACE_DEBUG ((LM_DEBUG, "(%P|%t) i1(\"\") [%u]\n", (unsigned long)i1)); ACE_DEBUG ((LM_DEBUG, "(%P|%t) i2(\"%u\") [%u]\n", l, (unsigned long)i2)); ACE_DEBUG ((LM_DEBUG, "(%P|%t) i3(\"%u\") [%u]\n", nl, (unsigned long)i3)); ACE_DEBUG ((LM_DEBUG, "(%P|%t) i4(\"%u\") [%u]\n", ul, (unsigned long)i4)); ACE_DEBUG ((LM_DEBUG, "(%P|%t) i5(\"%u\") [%u]\n", i, (unsigned long)i5)); ACE_DEBUG ((LM_DEBUG, "(%P|%t) i6(\"%u\") [%u]\n", ni, (unsigned long)i6)); ACE_DEBUG ((LM_DEBUG, "(%P|%t) i7(\"%u\") [%u]\n", ui, (unsigned long)i7)); // assignent i1 = i2; // obj ACE_ASSERT(i1 == i2); i1 = i1; // self ACE_ASSERT(i1 == i1); i1 = def; // unsigned long ACE_ASSERT(i1 == def); i1 = us; // unsigned short ACE_ASSERT(i1 == us); i1 = si; // unsigned short ACE_ASSERT(i1 == si); }
void MarchingCubeTriangulator::Triangulate(ScalarFieldBuilders::ScalarFieldCreator& inData,const SpatialDiscretization::weight_t& volId, progressOperation& mainProcess) { weigh_parameters_t weigh_parameters; weigh_parameters.volId=volId; BeginFeedingFaces(); ivec3 coordinates; long cellCount_m_one(inData.GetDomainSize()-1); ivec3 i1(1,0,0), i2(1,0,1), i3(0,0,1), i4(0,1,0), i5(1,1,0), i6(1,1,1), i7(0,1,1); PolygoniseAlgo::GRIDCELL grid; PolygoniseAlgo::TRIANGLE triList[5]; int nbtri; progressOperation thisProcess(&mainProcess, (unsigned int) (cellCount_m_one * cellCount_m_one)); for(coordinates.x=0;coordinates.x<cellCount_m_one;coordinates.x++) { for(coordinates.y=0;coordinates.y<cellCount_m_one;coordinates.y++) { progressOperation thisSubProcess(&thisProcess,1); if(VariationWithinFourZ(ivec2(coordinates.x,coordinates.y),inData)) { grid.p[3] = inData.GetCenterCellCoordinates(coordinates+i3); grid.p[2] = inData.GetCenterCellCoordinates(coordinates+i2); grid.p[7] = inData.GetCenterCellCoordinates(coordinates+i7); grid.p[6] = inData.GetCenterCellCoordinates(coordinates+i6); grid.val[3]=WeightEvaluation(inData.GetMatrixValue(coordinates),weigh_parameters); grid.val[2]=WeightEvaluation(inData.GetMatrixValue(coordinates+i1),weigh_parameters); grid.val[7]=WeightEvaluation(inData.GetMatrixValue(coordinates+i4),weigh_parameters); grid.val[6]=WeightEvaluation(inData.GetMatrixValue(coordinates+i5),weigh_parameters); for(coordinates.z=0;coordinates.z<cellCount_m_one;coordinates.z++) { //TODO Computation on x,y loop grid.p[0] = grid.p[3]; grid.p[1] = grid.p[2]; grid.p[4]= grid.p[7]; grid.p[5] = grid.p[6]; grid.p[2] = inData.GetCenterCellCoordinates(coordinates+i2); grid.p[3] = inData.GetCenterCellCoordinates(coordinates+i3); grid.p[6] = inData.GetCenterCellCoordinates(coordinates+i6); grid.p[7] = inData.GetCenterCellCoordinates(coordinates+i7); grid.val[0]=grid.val[3]; grid.val[1]=grid.val[2]; grid.val[4]=grid.val[7]; grid.val[5]=grid.val[6]; grid.val[2]=WeightEvaluation(inData.GetMatrixValue(coordinates+i2),weigh_parameters); grid.val[3]=WeightEvaluation(inData.GetMatrixValue(coordinates+i3),weigh_parameters); grid.val[6]=WeightEvaluation(inData.GetMatrixValue(coordinates+i6),weigh_parameters); grid.val[7]=WeightEvaluation(inData.GetMatrixValue(coordinates+i7),weigh_parameters); nbtri=PolygoniseAlgo::Polygonise(grid,0,triList); if(nbtri>0) { for(int idtri=0;idtri<nbtri;idtri++) { AddFace((const decimal *)&(triList[idtri].p[2]), (const decimal *)&(triList[idtri].p[1]), (const decimal *)&(triList[idtri].p[0])); } } } } } } FinishFeedingFaces(); }
void t() { i7(0,1,2,3,4,5,6); }
//----------------------------------------------------------------------------- //! //----------------------------------------------------------------------------- tApTurnSelectWidgetAC1242AC7080::tApTurnSelectWidgetAC1242AC7080( tPilotController& pilotDevice, QWidget* parent ) : tApWidget( pilotDevice, parent ), m_RequestedTurn( tPilotCommandInterface::PILOT_MODE_STANDBY ) { m_pGridMenu = new tGridMenu( 3, 3, this, false ); m_pGridMenu->SetIndexing( true ); setFocusProxy( m_pGridMenu ); QFont f = font(); f.setPixelSize( style()->pixelMetric( NPM( tNOSStyle::NPM_FontSizeSmallest ) ) ); m_pGridMenu->setFont( f ); QAction* pUTurnAction = new QAction( this ); QIcon i( QPixmap( tPath::ResourceFile( "simrad/autopilot/uturn.png" ) ) ); pUTurnAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_U_TURN ) ); pUTurnAction->setIcon( i ); pUTurnAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_U_TURN ); m_pGridMenu->AddAction( pUTurnAction, true ); Connect( pUTurnAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QAction* pCTurnAction = new QAction( this ); QIcon i2( QPixmap( tPath::ResourceFile( "simrad/autopilot/cturn.png" ) ) ); pCTurnAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_C_TURN ) ); pCTurnAction->setIcon( i2 ); pCTurnAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_C_TURN ); m_pGridMenu->AddAction( pCTurnAction, true ); Connect( pCTurnAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QAction* pSpiralAction = new QAction( this ); QIcon i3( QPixmap( tPath::ResourceFile( "simrad/autopilot/spiral.png" ) ) ); pSpiralAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_SPIRAL ) ); pSpiralAction->setIcon( i3 ); pSpiralAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_SPIRAL ); m_pGridMenu->AddAction( pSpiralAction, true ); Connect( pSpiralAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QAction* pZigzagAction = new QAction( this ); QIcon i4( QPixmap( tPath::ResourceFile( "simrad/autopilot/zigzag.png" ) ) ); pZigzagAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_ZIGZAG ) ); pZigzagAction->setIcon( i4 ); pZigzagAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_ZIGZAG ); m_pGridMenu->AddAction( pZigzagAction, true ); Connect( pZigzagAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QAction* pSquareAction = new QAction( this ); QIcon i5( QPixmap( tPath::ResourceFile( "simrad/autopilot/square.png" ) ) ); pSquareAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_SQUARE ) ); pSquareAction->setIcon( i5 ); pSquareAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_SQUARE ); m_pGridMenu->AddAction( pSquareAction, true ); Connect( pSquareAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QAction* pLazySAction = new QAction( this ); QIcon i6( QPixmap( tPath::ResourceFile( "simrad/autopilot/lazys.png" ) ) ); pLazySAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_LAZY_S ) ); pLazySAction->setIcon( i6 ); pLazySAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_LAZY_S ); m_pGridMenu->AddAction( pLazySAction, true ); Connect( pLazySAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QAction* pDCTAction = new QAction( this ); QIcon i7( QPixmap( tPath::ResourceFile( "simrad/autopilot/depth.png" ) ) ); pDCTAction->setText( m_PilotDevice.GetCommandInterface()->ModeAbbreviation( tPilotCommandInterface::PILOT_MODE_DEPTH_CONTOUR ) ); pDCTAction->setIcon( i7 ); pDCTAction->setProperty( "turnID", (int)tPilotCommandInterface::PILOT_MODE_DEPTH_CONTOUR ); m_pGridMenu->InsertAction( pDCTAction, 2, 1, true ); Connect( pDCTAction, SIGNAL( triggered() ), this, SLOT( OnTurnAction() ) ); QVBoxLayout* pMainLayout = new QVBoxLayout(); pMainLayout->setContentsMargins( 5, 5, 5, 5 ); pMainLayout->setSpacing( 5 ); pMainLayout->addWidget( m_pGridMenu, 0 ); setLayout( pMainLayout ); m_pGridMenu->SetSelectedItem( 1, 1 ); ShowCloseButton(); }