Example #1
0
void CGelDoc::OnEditSelectDelta() 
{
	int i;
	for (i = 0; i < 256; i++)
		m_abySelection[i] = ((m_abyTransform[i] == i)? 0x00 : 0xFF);

	ApplySelection();
}
Example #2
0
void CGelDoc::OnEditSelectInvert() 
{
	int i;
	for (i = 0; i < 256; i++)
		m_abySelection[i] = ~m_abySelection[i];

	ApplySelection();
}
Example #3
0
BOOL CGelDoc::LoadSample(LPCTSTR pszFilename)
{
	CFile file;
	CDib* pDib = NULL;

	TRY
	{
		if (!file.Open(pszFilename, CFile::modeRead | CFile::shareDenyNone))
			AfxThrowResourceException();

		pDib = new CDib();
		pDib->LoadDib(&file); // throws
		pDib->DeleteDib();
		delete pDib;
		pDib = NULL;

		// If we got this far, go for the gusto and replace our sample.

		delete m_pUntransformed;
		file.Seek(0L, CFile::begin);
		m_pUntransformed = new CDib(&file);

		delete m_pTransformed;
		file.Seek(0L, CFile::begin);
		m_pTransformed = new CDib(&file);

		delete m_pSelection;
		file.Seek(0L, CFile::begin);
		m_pSelection = new CDib(&file);

		file.Close();
	}
	CATCH_ALL(e)
	{
		if (pDib)
			delete pDib;

		if (file.m_hFile)
			file.Close();

		return FALSE;
	}
	END_CATCH_ALL

	ApplyGel();
	ApplySelection();
	CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
	if (pFrame)
		pFrame->UpdateSample();

	return TRUE;
}
Example #4
0
BOOL CGelDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	AfxGetPaletteApp()->SetAppPalette(IDB_SAMPLE1);

	int i;
	for (i = 0; i < 256; i++)
		m_abyTransform[i] = i;

	for (i = 0; i < 256; i++)
		m_abySelection[i] = 0xFF;
	BYTE byMask = m_pUntransformed->GetPixel(CPoint(0, 0));
	m_abySelection[byMask] = 0x00;
	ApplySelection();

	return TRUE;
}
Example #5
0
void Dlg_BCs::UpdateBCLists(void)
{
	int PrevCurRow = CurBcIndex;
	ui.BCList->clear();

	for (int i=0; i<pEnv->GetNumBCs(); i++){
		char ThisDofFixed = pEnv->GetBC(i)->DofFixed;
		QString MyName = "BC" + QString::number(i) + " : (";
		if (IS_FIXED(DOF_X, ThisDofFixed)) MyName += "*"; else MyName += "_";
		if (IS_FIXED(DOF_Y, ThisDofFixed)) MyName += "*"; else MyName += "_";
		if (IS_FIXED(DOF_Z, ThisDofFixed)) MyName += "*"; else MyName += "_";
		if (IS_FIXED(DOF_TX, ThisDofFixed)) MyName += "*"; else MyName += "_";
		if (IS_FIXED(DOF_TY, ThisDofFixed)) MyName += "*"; else MyName += "_";
		if (IS_FIXED(DOF_TZ, ThisDofFixed)) MyName += "*"; else MyName += "_";
		MyName += ")";

		new QListWidgetItem(MyName, ui.BCList);
	}

	ApplySelection(PrevCurRow);
//	ui.BCList->setCurrentRow(PrevCurRow);

	UpdateUI();
}
Example #6
0
void CGelDoc::OnEditSelectNone() 
{
	memset(m_abySelection, 0x00, sizeof(m_abySelection));
	ApplySelection();
}
Example #7
0
void CGelDoc::OnEditSelectAll() 
{
	memset(m_abySelection, 0xFF, sizeof(m_abySelection));
	ApplySelection();
}