Пример #1
0
bool CProgressThreadDlg::ExecuteFunctionWithProgressDialog(ProgressFunctionType* pfnFunction,
    const CString& sProgressTitle,
    int nSteps,
    void* pData,
    int nPriority)
{
  SetCaption(sProgressTitle);
  SetSteps(nSteps);
  CProgressThreadInfo Info;
  Info.m_pStatusDlg = this;
  Info.m_pfnFunction = pfnFunction;
  Info.m_pData = pData;
  m_pThread = AfxBeginThread(ProgressDialogWorkerThread, &Info, nPriority, 0, CREATE_SUSPENDED);

  // If the thread failed to create itself
  if (m_pThread == NULL) {
    ASSERT(0);
    return false;
  }

  // Start timer
  m_timeStart = CTime::GetCurrentTime();
  m_timeEnd = m_timeStart;

  // bring up the dialog modal (thread will close it for us)
  DoModal();

  return true;
}
Пример #2
0
/*************************************************************************
 * AM-TEMPO-TEXT-VIEW
 *************************************************************************/
AmTempoTextView::AmTempoTextView(	BRect frame,
									AmSongRef songRef,
									AmTrackRef trackRef)
		: inherited(frame, "AmTempoTextView", 0, 0,
					B_FOLLOW_TOP | B_FOLLOW_LEFT, B_WILL_DRAW),
		  mSongRef(songRef), mTrackRef(trackRef),
		  mContainer(NULL), mTempoChange(NULL)
{
	SetLimits(1, 400);
	SetSteps(1);
}
Пример #3
0
void C_Slider::LocalFunction(short ID,long P[],_TCHAR *,C_Handler *)
{
	switch(ID)
	{
		case CSLD_SETUP:
			Setup(P[0],(short)P[1]);
			break;
		case CSLD_SETBGIMAGE:
			SetBgImage(P[0]);
			break;
		case CSLD_SETSLIDERIMAGE:
			SetSliderImage(P[0]);
			break;
		case CSLD_SETSTEPS:
			SetSteps((short)P[0]);
			break;
	}
}
Пример #4
0
void StackedImageDataLIC3D::SimpleExecute(vtkImageData * input, vtkImageData * output)
{
    vtkDataArray * vectors = input->GetPointData()->GetVectors();
    if (!vectors)
    {
        vtkGenericWarningMacro("StackeImageDataLIC3D::SimpleExecute: missing input vectors");
        return;
    }

    initialize();

    auto appendTo3D = vtkSmartPointer<vtkImageAppend>::New();
    appendTo3D->SetAppendAxis(2);

    int inputExtent[6];
    input->GetExtent(inputExtent);

    for (int position = inputExtent[4]; position < inputExtent[5]; ++position)
    {
        int sliceExtent[6];
        input->GetExtent(sliceExtent);
        sliceExtent[4] = sliceExtent[5] = position;

        auto slice = vtkSmartPointer<vtkExtractVOI>::New();
        slice->SetVOI(sliceExtent);
        slice->SetInputData(input);

        auto lic2D = vtkSmartPointer<vtkImageDataLIC2D>::New();
        lic2D->SetInputConnection(0, slice->GetOutputPort());
        lic2D->SetInputConnection(1, m_noiseImage->GetOutputPort());
        lic2D->SetSteps(50);
        lic2D->GlobalWarningDisplayOff();
        lic2D->SetContext(m_glContext);

        appendTo3D->AddInputConnection(lic2D->GetOutputPort());
    }

    appendTo3D->Update();
    output->DeepCopy(appendTo3D->GetOutput());
}
Пример #5
0
CParametres::CParametres()
{
	SetSteps(0);
	SetHorizontalNumber(9);
	SetVerticalNumber(5);
}