dClass1::dClass1() { printf("in dClass1\n"); BaseClass* t = BaseClass::getInstance(); printf("BaseClass* is %d\n", t); xxxx(); }
XXXX () { dMatrix s; dFloat m = 2.0f; for (int i = 0; i < 3; i ++) { for (int j = 0; j < 3; j ++) { s[i][j] = m; m += (i + 1) + j; } } s.m_posit = dVector (1, 2, 3, 1); dMatrix matrix; dVector scale; dMatrix stretch; s.PolarDecomposition (matrix, scale, stretch); dMatrix s1 (matrix, scale, stretch); dMatrix xxx (dPitchMatrix (30.0f * 3.14159f / 180.0f) * dRollMatrix (30.0f * 3.14159f / 180.0f)); dMatrix xxxx (GetIdentityMatrix()); xxx[0] = xxx[0].Scale (-1.0f); dFloat mmm = (xxx[0] * xxx[1]) % xxx[2]; xxxx[0][0] = 3.0f; xxxx[1][1] = 3.0f; xxxx[2][2] = 4.0f; dMatrix xxx2 (xxx * xxxx); mmm = (xxx2[0] * xxx2[1]) % xxx2[2]; xxx2.PolarDecomposition (matrix, scale, stretch); s1 = dMatrix (matrix, scale, stretch); s1 = dMatrix (matrix, scale, stretch); }
bool CGridLocus::TransferDataToWindow() { nwxGridBatch xxxx(this); const COARallele *pAllele; bool bAmel = m_pLocusEdited->IsAmel(); vector<const COARallele *> va; m_pLocusEdited->GetAllelesByTime(&va,m_dtHistory); int nCol = (int)(va.size()); _SetNumberCols(nCol); for(int k = 0; k < nCol; k++) { pAllele = va.at(k); SetCellValue(ROW_ALLELE, k, pAllele->FormatName(bAmel,false)); SetCellValue(ROW_BPS, k, pAllele->FormatBPS()); SetCellValue(ROW_OFF_LADDER, k, pAllele->FormatOffLadder()); SetCellValue(ROW_HOMOZYGOUS, k, pAllele->FormatCount()); SetCellValue(ROW_RFU, k, pAllele->FormatRFU()); SetCellValue(ROW_TIME, k, pAllele->FormatTime()); SetCellValue(ROW_PEAK_AREA, k, pAllele->FormatPeakArea()); SetCellValue(ROW_DISABLE, k, pAllele->FormatDisabled()); UpdateDisabledAlleles(k); } AutoSizeColumns(); return true; }
void CGridAlerts::OnCellChange(wxGridEvent &e) { if( !(m_nInCellChangeEvent || IsTableReadOnly()) ) { CIncrementer x(m_nInCellChangeEvent); nwxGridBatch xxxx(this); int nRow = e.GetRow(); int nCol = e.GetCol(); COARmessage *pMsg = m_pMsgEdit->GetMessage((size_t) nRow); int nCols = GetNumberCols(); const wxString &sName(pMsg->GetMessageName()); if(nCol == (nCols - 1)) { UpdateTextFromRow(nRow,pMsg); } else if(nCol == (nCols - 2)) { UpdateDisabledFromRow(nRow,pMsg); if((!sName.IsEmpty()) && GetBoolValue(nRow,nCol)) { // a row has been enabled // check for mutually exclusive rows // that are enabled and disable them set<wxString> ss; const COARmsgExportMap *pMsgExp = m_pMsgEdit->GetMsgExport(); if(pMsgExp->GetGroupsByMsgName(sName,&ss)) { // we found group names size_t nCount = m_pMsgEdit->GetMessageCount(); size_t iRow; for(iRow = 0; iRow < nCount; iRow++) { if(iRow == (size_t)nRow) {} else if(!GetBoolValue(iRow,nCol)) {} // already unchecked, fuhgeddaboudit. else { COARmessage *pMsgA = m_pMsgEdit->GetMessage(iRow); const wxString &sNameA(pMsgA->GetMessageName()); if(sNameA.IsEmpty()) {} else if( (sNameA == sName) || (pMsgExp->HasGroupByMsgName(sNameA,ss)) ) { // need to uncheck message SetBoolValue(iRow,nCol,false); UpdateDisabledFromRow(iRow,pMsgA); } } } } } } } e.Skip(true); }
void read_string(char *s, FILE *fp) { short n; r_read(fp, (char *) &n, sizeof(short)); r_read(fp, s, n); xxxx(s, n); }
void write_string(char *s, FILE *fp) { short n; n = strlen(s) + 1; xxxx(s, n); r_write(fp, (char *) &n, sizeof(short)); r_write(fp, s, n); }
/** * Javadoc */ void aaaa() { char *c = new char[10]; if(a==0) { if(b==1) { } } xxxx(); while(true) { } }
void CGridLocus::UpdateDisabledAlleles(int nCol) { bool b; nwxGridBatch xxxx(this); b = GetBoolValue(ROW_DISABLE,nCol); if(IsTableReadOnly()) { SetGrayBackgroundCol(nCol,b); } else { DisableEdit(ROW_ALLELE,nCol,b); DisableEdit(ROW_BPS,nCol,b); DisableEdit(ROW_OFF_LADDER,nCol,b); DisableEdit(ROW_HOMOZYGOUS,nCol,b); } Refresh(); }
void AnimatedPlayerController(DemoEntityManager* const scene) { // load the sky box scene->CreateSkyBox(); dTrace(("sorry demo %s temporarilly disabled\n", __FUNCTION__)); return; #if 0 CreateLevelMesh(scene, "flatPlane.ngd", true); dMatrix origin (dGetIdentityMatrix()); origin.m_posit.m_y = -0.0f; dMatrix origin1 (origin); InverseKinematicAnimationManager* const animationManager = new InverseKinematicAnimationManager(scene); dPointer<DemoEntity> humanModel (DemoEntity::LoadNGD_mesh("whiteman.ngd", scene->GetNewton(), scene->GetShaderCache())); //dAnimIKController* const human = animationManager->CreateHuman("whiteman.ngd", origin1); dAnimIKController* const human = animationManager->CreateHuman(&(*humanModel), origin1); //dAnimIKController* const human = animationManager->CreateHuman("skintest.ngd", origin1); DemoEntity* const referenceModel = DemoEntity::LoadNGD_mesh("viper.ngd", scene->GetNewton(), scene->GetShaderCache()); origin1.m_posit.m_z = 2.0f; referenceModel->ResetMatrix(*scene, referenceModel->GetCurrentMatrix() * origin1); scene->Append(referenceModel); dMatrix xxxx(origin1); for (int i = 0; i < 10; i ++) { xxxx.m_posit.m_x += 2; dMatrix xxxx1(xxxx); for (int j = 0; j < 10; j ++) { xxxx1.m_posit.m_z -= 2; animationManager->CreateHuman(&(*humanModel), xxxx1); } } origin.m_posit = dVector(-4.0f, 1.0f, 0.0f, 1.0f); scene->SetCameraMatrix(dGetIdentityMatrix(), origin.m_posit); #endif }
static void CreateSimpleVoronoiShatter (DemoEntityManager* const scene) { // create a collision primitive // dVector size (2.0f, 2.0f, 2.0f); // dVector size = dVector (10.0f, 0.5f, 10.0f, 0.0f); dVector size = dVector (5.0f, 5.0f, 5.0f, 0.0f); NewtonWorld* const world = scene->GetNewton(); // NewtonCollision* const collision = CreateConvexCollision (world, GetIdentityMatrix(), size, _BOX_PRIMITIVE, 0); NewtonCollision* const collision = CreateConvexCollision (world, GetIdentityMatrix(), size, _CAPSULE_PRIMITIVE, 0); // NewtonCollision* const collision = CreateConvexCollision (world, GetIdentityMatrix(), size, _SPHERE_PRIMITIVE, 0); // NewtonCollision* const collision = CreateConvexCollision (world, GetIdentityMatrix(), size, _REGULAR_CONVEX_HULL_PRIMITIVE, 0); // NewtonCollision* const collision = CreateConvexCollision (world, GetIdentityMatrix(), size, _RANDOM_CONVEX_HULL_PRIMITIVE, 0); // create a newton mesh from the collision primitive NewtonMesh* const mesh = NewtonMeshCreateFromCollision(collision); // apply a simple Box Mapping int tex0 = LoadTexture("reljef.tga"); NewtonMeshApplyBoxMapping(mesh, tex0, tex0, tex0); // pepper the bing box of the mesh with random points dVector points[NUMBER_OF_ITERNAL_PARTS + 100]; int count = 0; while (count < NUMBER_OF_ITERNAL_PARTS) { dFloat x = RandomVariable(size.m_x); dFloat y = RandomVariable(size.m_y); dFloat z = RandomVariable(size.m_z); if ((x <= size.m_x) && (x >= -size.m_x) && (y <= size.m_y) && (y >= -size.m_y) && (z <= size.m_z) && (z >= -size.m_z)){ points[count] = dVector (x, y, z); count ++; } } count = 4; // Create the array of convex pieces from the mesh int interior = LoadTexture("KAMEN-stup.tga"); // int interior = LoadTexture("camo.tga"); dMatrix textureMatrix (GetIdentityMatrix()); textureMatrix[0][0] = 1.0f / size.m_x; textureMatrix[1][1] = 1.0f / size.m_y; NewtonMesh* const convexParts = NewtonMeshVoronoiDecomposition (mesh, count, sizeof (dVector), &points[0].m_x, interior, &textureMatrix[0][0]); // NewtonMesh* const convexParts = NewtonMeshConvexDecomposition (mesh, 1000000); #if 1 dScene xxxx(world); dScene::dTreeNode* const modelNode = xxxx.CreateSceneNode(xxxx.GetRootNode()); dScene::dTreeNode* const meshNode = xxxx.CreateMeshNode(modelNode); dMeshNodeInfo* const modelMesh = (dMeshNodeInfo*)xxxx.GetInfoFromNode(meshNode); modelMesh->ReplaceMesh (convexParts); xxxx.Serialize("../../../media/xxx.ngd"); #endif DemoEntity* const entity = new DemoEntity(NULL); entity->SetMatrix(*scene, dQuaternion(), dVector (0, 10, 0, 0)); entity->InterpolateMatrix (*scene, 1.0f); scene->Append (entity); DemoMesh* const mesh1 = new DemoMesh(convexParts); entity->SetMesh(mesh1); mesh1->Release(); /* DemoEntity* const entity2 = new DemoEntity(NULL); entity2->SetMatrix(*scene, dQuaternion(), dVector (0, 10, 0, 0)); entity2->InterpolateMatrix (*scene, 1.0f); scene->Append (entity2); DemoMesh* const mesh2 = new DemoMesh(mesh); entity2->SetMesh(mesh2); mesh2->Release(); */ // make sure the assets are released before leaving the function if (convexParts) { NewtonMeshDestroy (convexParts); } NewtonMeshDestroy (mesh); NewtonReleaseCollision(world, collision); }