예제 #1
0
void EditOptions::setProjectDir(std::string projDir)
    {
    if(projDir.length() > 0)
        {
        FilePath projName(projDir, FP_Dir);
        projName.appendFile("oovEditConfig.txt");
        setFilename(projName);
        }
    }
예제 #2
0
ossimProjection* ossimFgdcXmlDoc::getProjection()
{
   if ( m_projection.valid() )
   {
      return m_projection.get();
   }
   
   ossimDrect rect = getBoundingBox();
   ossimString projName (getProjCsn());
   
   if (!projName.empty())
   {
      m_projection = ossimEpsgProjectionFactory::instance()->createProjection(projName);
      
      if ( m_projection.valid() )
      {
         ossimDpt gsd(fabs(getXRes()), fabs(getYRes()));
         ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(m_projection.get());
         if (mapProj)
         {
            if (mapProj->isGeographic())
            {
               ossimGpt tie(rect.ul().lat, rect.ul().lon);
               mapProj->setUlTiePoints(tie);
               mapProj->setDecimalDegreesPerPixel(gsd);
            }
            else
            {
               ossimDpt tie(rect.ul().x, rect.ul().y);
               if (getUnits().upcase() == "FEET")
               {
                  gsd = gsd * METER_PER_FOOT;
                  tie = tie * METER_PER_FOOT;
               }
               mapProj->setUlTiePoints(tie);
               mapProj->setMetersPerPixel(gsd);
            }
         }
      }
   }
   return m_projection.get();
}
예제 #3
0
void OutputPane::OnBuildWindowDClick(const wxString &line, int lineno)
{
	wxString fileName, strLineNumber;
	bool match = false;

	//get the selected compiler for the current line that was DClicked
	if(lineno >= (int)m_buildLineInfo.GetCount()){
		return;
	}

	//find the project selected build configuration for the workspace selected
	//configuration
	wxString projectName = m_buildLineInfo.Item(lineno);
	
	if(projectName.IsEmpty())
		return;
		
	BuildMatrixPtr matrix = ManagerST::Get()->GetWorkspaceBuildMatrix();
	wxString projecBuildConf = matrix->GetProjectSelectedConf(matrix->GetSelectedConfigurationName(), 
																				 projectName	);
	ProjectSettingsPtr settings = ManagerST::Get()->GetProject(projectName)->GetSettings();
	if(!settings)
	{
		return;
	}
	
	BuildConfigPtr  bldConf = settings->GetBuildConfiguration(projecBuildConf);
	if( !bldConf )
	{
		return;
	}
	
	wxString cmpType = bldConf->GetCompilerType();
	CompilerPtr cmp = BuildSettingsConfigST::Get()->GetCompiler(cmpType);
	if( !cmp )
	{
		return;
	}
	
	long idx;
	//try to match an error pattern to the line
	RegexProcessor re(cmp->GetErrPattern());
	cmp->GetErrFileNameIndex().ToLong(&idx);
	if(re.GetGroup(line, idx, fileName))
	{
		//we found the file name, get the line number
		cmp->GetErrLineNumberIndex().ToLong(&idx);
		re.GetGroup(line, idx, strLineNumber);
		match = true;
	}

	//try to match warning pattern
	if(!match)
	{
		RegexProcessor re(cmp->GetWarnPattern());
		cmp->GetWarnFileNameIndex().ToLong(&idx);
		if(re.GetGroup(line, idx, fileName))
		{
			//we found the file name, get the line number
			cmp->GetWarnLineNumberIndex().ToLong(&idx);
			re.GetGroup(line, idx, strLineNumber);
			match = true;
		}
	}

	if(match)
	{
		long lineNumber = -1;
		strLineNumber.ToLong(&lineNumber);

		// open the file in the editor
		// get the project name that is currently being built
		wxString projName(wxEmptyString);
		if(lineno < (int)m_buildLineInfo.GetCount())
		{
			projName = m_buildLineInfo.Item(lineno);
		}
		
		// if no project found, dont do anything
		if(projName.IsEmpty())
		{
			return;
		}

		DirSaver ds;
		ProjectPtr pro = ManagerST::Get()->GetProject(projName);
		::wxSetWorkingDirectory(pro->GetFileName().GetPath());
		wxFileName fn(fileName);
		fn.MakeAbsolute(pro->GetFileName().GetPath());

		ManagerST::Get()->OpenFile(fn.GetFullPath(), projName, lineNumber - 1 );
	}
}